[Vm-dev] [commit][3283] CogVM source as per VMMaker.oscog-eem.1111
commits at squeakvm.org
commits at squeakvm.org
Mon Mar 23 05:44:57 UTC 2015
Revision: 3283
Author: eliot
Date: 2015-03-22 22:44:52 -0700 (Sun, 22 Mar 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1111
Fix misgeneration of saveAndRestoreLinkRegAround: by not marking as required
<inline: true> methods in CogAbstractInstruction. Has the nice side-effect of
deleting ~ 2000 lines of dead code from cogit.c. Revert the bogus fix to
preGenerationHook:.
Fix type coercion in propagateReturnIn: to not generate unnecessary casts.
Do dead-code elimination on (expr and: [false]) ifTrue:
and hence fix a few exprs in primitiveVMMarameter
Merge in Nicolas' fixes for incorrect use of #|.
Refactor the enilopmart creation machinery so that there is only one creation
routine, adding a forCall: parameter to differentiate enter and call
enilopmarts.
Fix CogMethodZone>>whereIsMaybeCodeThing: which was testing the wrong boundary.
Modified Paths:
--------------
branches/Cog/nsspursrc/plugins/B2DPlugin/B2DPlugin.c
branches/Cog/nsspursrc/plugins/BitBltPlugin/BitBltPlugin.c
branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c
branches/Cog/nsspursrc/vm/cogit.c
branches/Cog/nsspursrc/vm/cogit.h
branches/Cog/nsspursrc/vm/cointerp.c
branches/Cog/nsspursrc/vm/cointerp.h
branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
branches/Cog/nsspurstacksrc/vm/interp.c
branches/Cog/sistasrc/vm/cogit.c
branches/Cog/sistasrc/vm/cogit.h
branches/Cog/sistasrc/vm/cointerp.c
branches/Cog/sistasrc/vm/cointerp.h
branches/Cog/sistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursistasrc/vm/cogit.c
branches/Cog/spursistasrc/vm/cogit.h
branches/Cog/spursistasrc/vm/cointerp.c
branches/Cog/spursistasrc/vm/cointerp.h
branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/cogit.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spurstack64src/vm/gcc3x-interp.c
branches/Cog/spurstack64src/vm/interp.c
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c
branches/Cog/src/plugins/B2DPlugin/B2DPlugin.c
branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c
branches/Cog/src/plugins/LargeIntegers/LargeIntegers.c
branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c
branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c
branches/Cog/src/vm/cogit.c
branches/Cog/src/vm/cogit.h
branches/Cog/src/vm/cointerp.c
branches/Cog/src/vm/cointerp.h
branches/Cog/src/vm/cointerpmt.c
branches/Cog/src/vm/cointerpmt.h
branches/Cog/src/vm/gcc3x-cointerp.c
branches/Cog/src/vm/gcc3x-cointerpmt.c
branches/Cog/stacksrc/vm/gcc3x-interp.c
branches/Cog/stacksrc/vm/interp.c
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nsspursrc/plugins/B2DPlugin/B2DPlugin.c
===================================================================
--- branches/Cog/nsspursrc/plugins/B2DPlugin/B2DPlugin.c 2015-03-18 01:46:21 UTC (rev 3282)
+++ branches/Cog/nsspursrc/plugins/B2DPlugin/B2DPlugin.c 2015-03-23 05:44:52 UTC (rev 3283)
@@ -1,9 +1,9 @@
/* Automatically generated by
- VMPluginCodeGenerator VMMaker.oscog-eem.1080 uuid: 8b1a09b7-4f58-4375-b16a-e42e63ffd542
+ VMPluginCodeGenerator VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
from
- BalloonEnginePlugin VMMaker.oscog-eem.1080 uuid: 8b1a09b7-4f58-4375-b16a-e42e63ffd542
+ BalloonEnginePlugin VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
*/
-static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.1080 uuid: 8b1a09b7-4f58-4375-b16a-e42e63ffd542 " __DATE__ ;
+static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146 " __DATE__ ;
@@ -836,9 +836,9 @@
static void * loadBBFn;
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
- "B2DPlugin VMMaker.oscog-eem.1080 (i)"
+ "B2DPlugin VMMaker.oscog-eem.1111 (i)"
#else
- "B2DPlugin VMMaker.oscog-eem.1080 (e)"
+ "B2DPlugin VMMaker.oscog-eem.1111 (e)"
#endif
;
static int* objBuffer;
@@ -1644,7 +1644,7 @@
else {
/* begin makeUnsignedFrom: */
someIntegerValue = (colormapOf(bmFill))[value];
- value = ((sqInt) someIntegerValue);
+ value = someIntegerValue;
}
}
return uncheckedTransformColor(value);
@@ -3000,7 +3000,7 @@
else {
/* begin makeUnsignedFrom: */
someIntegerValue = (colormapOf(bmFill))[value];
- value = ((sqInt) someIntegerValue);
+ value = someIntegerValue;
}
}
fillValue = uncheckedTransformColor(value);
@@ -3124,7 +3124,7 @@
else {
/* begin makeUnsignedFrom: */
someIntegerValue1 = (colormapOf(bmFill))[value1];
- value1 = ((sqInt) someIntegerValue1);
+ value1 = someIntegerValue1;
}
}
fillValue = uncheckedTransformColor(value1);
@@ -3248,7 +3248,7 @@
else {
/* begin makeUnsignedFrom: */
someIntegerValue2 = (colormapOf(bmFill))[value2];
- value2 = ((sqInt) someIntegerValue2);
+ value2 = someIntegerValue2;
}
}
fillValue = uncheckedTransformColor(value2);
@@ -3480,7 +3480,7 @@
else {
/* begin makeUnsignedFrom: */
someIntegerValue = (colormapOf(bmFill))[value];
- value = ((sqInt) someIntegerValue);
+ value = someIntegerValue;
}
}
fillValue = uncheckedTransformColor(value);
Modified: branches/Cog/nsspursrc/plugins/BitBltPlugin/BitBltPlugin.c
===================================================================
--- branches/Cog/nsspursrc/plugins/BitBltPlugin/BitBltPlugin.c 2015-03-18 01:46:21 UTC (rev 3282)
+++ branches/Cog/nsspursrc/plugins/BitBltPlugin/BitBltPlugin.c 2015-03-23 05:44:52 UTC (rev 3283)
@@ -1,9 +1,9 @@
/* Automatically generated by
- SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1072 uuid: bd9d8dd5-dea0-49da-8be7-cb246f49f554
+ SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
from
- BitBltSimulation VMMaker.oscog-eem.1072 uuid: bd9d8dd5-dea0-49da-8be7-cb246f49f554
+ BitBltSimulation VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
*/
-static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.1072 uuid: bd9d8dd5-dea0-49da-8be7-cb246f49f554 " __DATE__ ;
+static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146 " __DATE__ ;
@@ -344,9 +344,9 @@
};
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
- "BitBltPlugin VMMaker.oscog-eem.1072 (i)"
+ "BitBltPlugin VMMaker.oscog-eem.1111 (i)"
#else
- "BitBltPlugin VMMaker.oscog-eem.1072 (e)"
+ "BitBltPlugin VMMaker.oscog-eem.1111 (e)"
#endif
;
static sqInt noHalftone;
@@ -995,7 +995,7 @@
pv = cmLookupTable[pv & cmMask];
}
}
- sourceWord = ((sqInt) pv);
+ sourceWord = pv;
/* Store back */
@@ -2410,7 +2410,7 @@
pv = cmLookupTable[pv & cmMask];
}
}
- destPix = ((sqInt) pv);
+ destPix = pv;
/* adjust dest pix index */
@@ -4124,11 +4124,11 @@
mapIndex = ((sqInt) (sourcePixel & 0xFFFFFF));
goto l1;
}
- mapIndex = ((sqInt) sourcePixel);
+ mapIndex = sourcePixel;
goto l1;
}
if (sourcePixel == 0) {
- mapIndex = ((sqInt) sourcePixel);
+ mapIndex = sourcePixel;
goto l1;
}
d = 5 - cmBitsPerColor;
@@ -4142,7 +4142,7 @@
srcPix = ((usqInt) srcPix) >> d;
destPix = (destPix + (srcPix & mask)) + ((((usqInt) srcPix) >> d) & (mask << cmBitsPerColor));
if (destPix == 0) {
- mapIndex = ((sqInt) 1);
+ mapIndex = 1;
goto l1;
}
mapIndex = ((sqInt) destPix);
@@ -4188,11 +4188,11 @@
mapIndex = ((sqInt) ((((usqInt) destinationWord) >> 16) & 0xFFFFFF));
goto l2;
}
- mapIndex = ((sqInt) (((usqInt) destinationWord) >> 16));
+ mapIndex = ((usqInt) destinationWord) >> 16;
goto l2;
}
if ((((usqInt) destinationWord) >> 16) == 0) {
- mapIndex = ((sqInt) (((usqInt) destinationWord) >> 16));
+ mapIndex = ((usqInt) destinationWord) >> 16;
goto l2;
}
d1 = 5 - cmBitsPerColor;
@@ -4206,7 +4206,7 @@
srcPix1 = ((usqInt) srcPix1) >> d1;
destPix1 = (destPix1 + (srcPix1 & mask3)) + ((((usqInt) srcPix1) >> d1) & (mask3 << cmBitsPerColor));
if (destPix1 == 0) {
- mapIndex = ((sqInt) 1);
+ mapIndex = 1;
goto l2;
}
mapIndex = ((sqInt) destPix1);
@@ -4257,11 +4257,11 @@
mapIndex = ((sqInt) (destinationWord & 0xFFFFFF));
goto l3;
}
- mapIndex = ((sqInt) destinationWord);
+ mapIndex = destinationWord;
goto l3;
}
if (destinationWord == 0) {
- mapIndex = ((sqInt) destinationWord);
+ mapIndex = destinationWord;
goto l3;
}
d2 = 8 - cmBitsPerColor;
@@ -4275,7 +4275,7 @@
srcPix2 = ((usqInt) srcPix2) >> d2;
destPix2 = (destPix2 + (srcPix2 & mask4)) + ((((usqInt) srcPix2) >> d2) & (mask4 << cmBitsPerColor));
if (destPix2 == 0) {
- mapIndex = ((sqInt) 1);
+ mapIndex = 1;
goto l3;
}
mapIndex = ((sqInt) destPix2);
@@ -4860,7 +4860,7 @@
pv = cmLookupTable[pv & cmMask];
}
}
- destPix = ((sqInt) pv);
+ destPix = pv;
/* adjust dest pix index */
@@ -6179,7 +6179,7 @@
pv = cmLookupTable[pv & cmMask];
}
}
- sourceWord = ((sqInt) pv);
+ sourceWord = pv;
/* Store back */
@@ -6935,11 +6935,11 @@
mapIndex = ((sqInt) (pixVal & 0xFFFFFF));
goto l1;
}
- mapIndex = ((sqInt) pixVal);
+ mapIndex = pixVal;
goto l1;
}
if (pixVal == 0) {
- mapIndex = ((sqInt) pixVal);
+ mapIndex = pixVal;
goto l1;
}
d = 5 - cmBitsPerColor;
@@ -6953,7 +6953,7 @@
srcPix = ((usqInt) srcPix) >> d;
destPix = (destPix + (srcPix & mask)) + ((((usqInt) srcPix) >> d) & (mask << cmBitsPerColor));
if (destPix == 0) {
- mapIndex = ((sqInt) 1);
+ mapIndex = 1;
goto l1;
}
mapIndex = ((sqInt) destPix);
@@ -7000,11 +7000,11 @@
mapIndex = ((sqInt) (pixVal & 0xFFFFFF));
goto l2;
}
- mapIndex = ((sqInt) pixVal);
+ mapIndex = pixVal;
goto l2;
}
if (pixVal == 0) {
- mapIndex = ((sqInt) pixVal);
+ mapIndex = pixVal;
goto l2;
}
d1 = 8 - cmBitsPerColor;
@@ -7018,7 +7018,7 @@
srcPix1 = ((usqInt) srcPix1) >> d1;
destPix1 = (destPix1 + (srcPix1 & mask3)) + ((((usqInt) srcPix1) >> d1) & (mask3 << cmBitsPerColor));
if (destPix1 == 0) {
- mapIndex = ((sqInt) 1);
+ mapIndex = 1;
goto l2;
}
mapIndex = ((sqInt) destPix1);
@@ -7769,7 +7769,7 @@
pv = cmLookupTable[pv & cmMask];
}
}
- destPix = ((sqInt) pv);
+ destPix = pv;
destWord1 = destWord1 | ((destPix & dstMask) << dstBitShift);
dstBitShift += dstShiftInc;
sx += xDelta;
@@ -8163,7 +8163,7 @@
pv = cmLookupTable[pv & cmMask];
}
}
- destPix = ((sqInt) pv);
+ destPix = pv;
destWord = destWord | ((destPix & dstMask) << dstBitShift);
dstBitShift += dstShiftInc;
sx += xDeltah;
Modified: branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c
===================================================================
--- branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c 2015-03-18 01:46:21 UTC (rev 3282)
+++ branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c 2015-03-23 05:44:52 UTC (rev 3283)
@@ -1,9 +1,9 @@
/* Automatically generated by
- SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
from
- LargeIntegersPlugin VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ LargeIntegersPlugin VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
*/
-static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245 " __DATE__ ;
+static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146 " __DATE__ ;
@@ -174,9 +174,9 @@
struct VirtualMachine* interpreterProxy;
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
- "LargeIntegers v1.5 VMMaker.oscog-eem.1088 (i)"
+ "LargeIntegers v1.5 VMMaker.oscog-eem.1111 (i)"
#else
- "LargeIntegers v1.5 VMMaker.oscog-eem.1088 (e)"
+ "LargeIntegers v1.5 VMMaker.oscog-eem.1111 (e)"
#endif
;
static const int orOpIndex = 1;
@@ -489,7 +489,7 @@
/* C indexed! */
/* begin cBytesReplace:from:to:with:startingAt: */
- ((int) (cBytesCopyFromtolen(pFrom + b, pTo + 0, ((newLen - 1) - 0) + 1)));
+ cBytesCopyFromtolen(pFrom + b, pTo + 0, ((newLen - 1) - 0) + 1);
goto l5;
}
x1 = (pFrom[b]) << f;
@@ -685,7 +685,7 @@
/* C indexed! */
/* begin cBytesReplace:from:to:with:startingAt: */
- return ((int) (cBytesCopyFromtolen(pFrom + b, pTo + 0, ((toLen - 1) - 0) + 1)));
+ return cBytesCopyFromtolen(pFrom + b, pTo + 0, ((toLen - 1) - 0) + 1);
}
x = (pFrom[b]) << f;
/* begin sqAssert: */
Modified: branches/Cog/nsspursrc/vm/cogit.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.c 2015-03-18 01:46:21 UTC (rev 3282)
+++ branches/Cog/nsspursrc/vm/cogit.c 2015-03-23 05:44:52 UTC (rev 3283)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1096 uuid: a138f73f-adc5-4a10-af7b-b1a8276295dd
+ CCodeGenerator VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1096 uuid: a138f73f-adc5-4a10-af7b-b1a8276295dd
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1096 uuid: a138f73f-adc5-4a10-af7b-b1a8276295dd " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1111 uuid: d49aabf6-9652-4eaf-b08d-0ccddc9c9146 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -317,6 +317,7 @@
#define ReceiverIndex 5
#define ReceiverResultReg -3
#define RetN 10
+#define RISCTempReg 10
#define SelectorCannotInterpret 34
#define SelectorDoesNotUnderstand 20
#define SenderIndex 0
@@ -381,14 +382,8 @@
static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;
static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
static sqInt availableRegisterOrNilFor(AbstractInstruction * self_in_availableRegisterOrNilFor, sqInt liveRegsMask) NoDbgRegParms;
-static sqInt computeJumpTargetOffsetPlus(AbstractInstruction * self_in_computeJumpTargetOffsetPlus, sqInt anPCOffset) NoDbgRegParms;
-static sqInt concretizeLabel(AbstractInstruction * self_in_concretizeLabel) NoDbgRegParms;
static sqInt genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment) NoDbgRegParms;
static AbstractInstruction * generateICacheFlush(AbstractInstruction * self_in_generateICacheFlush) NoDbgRegParms;
-static AbstractInstruction * genJumpFPGreaterOrEqual(AbstractInstruction * self_in_genJumpFPGreaterOrEqual, void *jumpTarget) NoDbgRegParms;
-static AbstractInstruction * genJumpFPGreater(AbstractInstruction * self_in_genJumpFPGreater, void *jumpTarget) NoDbgRegParms;
-static AbstractInstruction * genJumpFPLessOrEqual(AbstractInstruction * self_in_genJumpFPLessOrEqual, void *jumpTarget) NoDbgRegParms;
-static AbstractInstruction * genJumpFPLess(AbstractInstruction * self_in_genJumpFPLess, void *jumpTarget) NoDbgRegParms;
static AbstractInstruction * genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) NoDbgRegParms;
static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget) NoDbgRegParms;
static sqInt hasPCRegister(AbstractInstruction * self_in_hasPCRegister) NoDbgRegParms;
@@ -396,13 +391,12 @@
static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction) NoDbgRegParms;
static sqInt isJump(AbstractInstruction * self_in_isJump) NoDbgRegParms;
static sqInt isLongJump(AbstractInstruction * self_in_isLongJump) NoDbgRegParms;
-static AbstractInstruction * jumpTargetAddress(AbstractInstruction * self_in_jumpTargetAddress) NoDbgRegParms;
static unsigned long labelOffset(AbstractInstruction * self_in_labelOffset) NoDbgRegParms;
-static AbstractInstruction * longJumpTargetAddress(AbstractInstruction * self_in_longJumpTargetAddress) NoDbgRegParms;
static sqInt numICacheFlushOpcodes(AbstractInstruction * self_in_numICacheFlushOpcodes) NoDbgRegParms;
static AbstractInstruction * resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget) NoDbgRegParms;
static sqInt setLabelOffset(AbstractInstruction * self_in_setLabelOffset, sqInt aValue) NoDbgRegParms;
static AbstractInstruction * updateLabel(AbstractInstruction * self_in_updateLabel, AbstractInstruction *labelInstruction) NoDbgRegParms;
+static sqInt wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject) NoDbgRegParms;
static CogMethod * cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) NoDbgRegParms;
static sqInt isBranch(BytecodeDescriptor * self_in_isBranch) NoDbgRegParms;
static sqInt isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch) NoDbgRegParms;
@@ -416,78 +410,10 @@
static sqInt computeShiftRRSize(AbstractInstruction * self_in_computeShiftRRSize) NoDbgRegParms;
static sqInt concreteDPFPRegister(AbstractInstruction * self_in_concreteDPFPRegister, sqInt registerIndex) NoDbgRegParms;
static sqInt concreteRegister(AbstractInstruction * self_in_concreteRegister, sqInt registerIndex) NoDbgRegParms;
-static sqInt concretizeAddCqR(AbstractInstruction * self_in_concretizeAddCqR) NoDbgRegParms;
-static sqInt concretizeAddCwR(AbstractInstruction * self_in_concretizeAddCwR) NoDbgRegParms;
-static sqInt concretizeAddRR(AbstractInstruction * self_in_concretizeAddRR) NoDbgRegParms;
-static AbstractInstruction * concretizeAlignmentNops(AbstractInstruction * self_in_concretizeAlignmentNops) NoDbgRegParms;
-static sqInt concretizeAndCqR(AbstractInstruction * self_in_concretizeAndCqR) NoDbgRegParms;
-static sqInt concretizeAndCwR(AbstractInstruction * self_in_concretizeAndCwR) NoDbgRegParms;
-static sqInt concretizeAndRR(AbstractInstruction * self_in_concretizeAndRR) NoDbgRegParms;
-static sqInt concretizeArithmeticShiftRightCqR(AbstractInstruction * self_in_concretizeArithmeticShiftRightCqR) NoDbgRegParms;
-static sqInt concretizeArithmeticShiftRightRR(AbstractInstruction * self_in_concretizeArithmeticShiftRightRR) NoDbgRegParms;
static sqInt concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress) NoDbgRegParms;
-static sqInt concretizeCall(AbstractInstruction * self_in_concretizeCall) NoDbgRegParms;
-static sqInt concretizeCDQ(AbstractInstruction * self_in_concretizeCDQ) NoDbgRegParms;
-static sqInt concretizeCMPXCHGAwR(AbstractInstruction * self_in_concretizeCMPXCHGAwR) NoDbgRegParms;
-static sqInt concretizeCMPXCHGMwrR(AbstractInstruction * self_in_concretizeCMPXCHGMwrR) NoDbgRegParms;
-static sqInt concretizeCmpCqR(AbstractInstruction * self_in_concretizeCmpCqR) NoDbgRegParms;
-static sqInt concretizeCmpCwR(AbstractInstruction * self_in_concretizeCmpCwR) NoDbgRegParms;
-static sqInt concretizeCmpRdRd(AbstractInstruction * self_in_concretizeCmpRdRd) NoDbgRegParms;
-static sqInt concretizeCmpRR(AbstractInstruction * self_in_concretizeCmpRR) NoDbgRegParms;
-static sqInt concretizeConditionalJumpLong(AbstractInstruction * self_in_concretizeConditionalJumpLong, sqInt conditionCode) NoDbgRegParms;
-static sqInt concretizeConditionalJump(AbstractInstruction * self_in_concretizeConditionalJump, sqInt conditionCode) NoDbgRegParms;
-static sqInt concretizeConvertRRd(AbstractInstruction * self_in_concretizeConvertRRd) NoDbgRegParms;
-static sqInt concretizeCPUID(AbstractInstruction * self_in_concretizeCPUID) NoDbgRegParms;
-static sqInt concretizeFENCE(AbstractInstruction * self_in_concretizeFENCE, sqInt regOpcode) NoDbgRegParms;
static sqInt concretizeFill16(AbstractInstruction * self_in_concretizeFill16) NoDbgRegParms;
static sqInt concretizeFill32(AbstractInstruction * self_in_concretizeFill32) NoDbgRegParms;
static sqInt concretizeFillFromWord(AbstractInstruction * self_in_concretizeFillFromWord) NoDbgRegParms;
-static sqInt concretizeIDIVR(AbstractInstruction * self_in_concretizeIDIVR) NoDbgRegParms;
-static sqInt concretizeJump(AbstractInstruction * self_in_concretizeJump) NoDbgRegParms;
-static sqInt concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong) NoDbgRegParms;
-static sqInt concretizeJumpR(AbstractInstruction * self_in_concretizeJumpR) NoDbgRegParms;
-static sqInt concretizeLOCK(AbstractInstruction * self_in_concretizeLOCK) NoDbgRegParms;
-static sqInt concretizeLoadEffectiveAddressMwrR(AbstractInstruction * self_in_concretizeLoadEffectiveAddressMwrR) NoDbgRegParms;
-static sqInt concretizeLogicalShiftLeftCqR(AbstractInstruction * self_in_concretizeLogicalShiftLeftCqR) NoDbgRegParms;
-static sqInt concretizeLogicalShiftLeftRR(AbstractInstruction * self_in_concretizeLogicalShiftLeftRR) NoDbgRegParms;
-static sqInt concretizeLogicalShiftRightCqR(AbstractInstruction * self_in_concretizeLogicalShiftRightCqR) NoDbgRegParms;
-static sqInt concretizeMoveAwR(AbstractInstruction * self_in_concretizeMoveAwR) NoDbgRegParms;
-static sqInt concretizeMoveCqR(AbstractInstruction * self_in_concretizeMoveCqR) NoDbgRegParms;
-static sqInt concretizeMoveCwR(AbstractInstruction * self_in_concretizeMoveCwR) NoDbgRegParms;
-static sqInt concretizeMoveM16rR(AbstractInstruction * self_in_concretizeMoveM16rR) NoDbgRegParms;
-static sqInt concretizeMoveM64rRd(AbstractInstruction * self_in_concretizeMoveM64rRd) NoDbgRegParms;
-static sqInt concretizeMoveMbrR(AbstractInstruction * self_in_concretizeMoveMbrR) NoDbgRegParms;
-static sqInt concretizeMoveMwrR(AbstractInstruction * self_in_concretizeMoveMwrR) NoDbgRegParms;
-static sqInt concretizeMoveRAw(AbstractInstruction * self_in_concretizeMoveRAw) NoDbgRegParms;
-static sqInt concretizeMoveRdM64r(AbstractInstruction * self_in_concretizeMoveRdM64r) NoDbgRegParms;
-static sqInt concretizeMoveRMbr(AbstractInstruction * self_in_concretizeMoveRMbr) NoDbgRegParms;
-static sqInt concretizeMoveRMwr(AbstractInstruction * self_in_concretizeMoveRMwr) NoDbgRegParms;
-static sqInt concretizeMoveRR(AbstractInstruction * self_in_concretizeMoveRR) NoDbgRegParms;
-static sqInt concretizeMoveRXbrR(AbstractInstruction * self_in_concretizeMoveRXbrR) NoDbgRegParms;
-static sqInt concretizeMoveRXwrR(AbstractInstruction * self_in_concretizeMoveRXwrR) NoDbgRegParms;
-static sqInt concretizeMoveXbrRR(AbstractInstruction * self_in_concretizeMoveXbrRR) NoDbgRegParms;
-static sqInt concretizeMoveXwrRR(AbstractInstruction * self_in_concretizeMoveXwrRR) NoDbgRegParms;
-static sqInt concretizeMulRR(AbstractInstruction * self_in_concretizeMulRR) NoDbgRegParms;
-static sqInt concretizeNegateR(AbstractInstruction * self_in_concretizeNegateR) NoDbgRegParms;
-static sqInt concretizeNop(AbstractInstruction * self_in_concretizeNop) NoDbgRegParms;
-static sqInt concretizeOrCqR(AbstractInstruction * self_in_concretizeOrCqR) NoDbgRegParms;
-static sqInt concretizeOrCwR(AbstractInstruction * self_in_concretizeOrCwR) NoDbgRegParms;
-static sqInt concretizeOrRR(AbstractInstruction * self_in_concretizeOrRR) NoDbgRegParms;
-static sqInt concretizePopR(AbstractInstruction * self_in_concretizePopR) NoDbgRegParms;
-static sqInt concretizePrefetchAw(AbstractInstruction * self_in_concretizePrefetchAw) NoDbgRegParms;
-static sqInt concretizePushCw(AbstractInstruction * self_in_concretizePushCw) NoDbgRegParms;
-static sqInt concretizePushR(AbstractInstruction * self_in_concretizePushR) NoDbgRegParms;
-static sqInt concretizeRetN(AbstractInstruction * self_in_concretizeRetN) NoDbgRegParms;
-static sqInt concretizeSEE2OpRdRd(AbstractInstruction * self_in_concretizeSEE2OpRdRd, sqInt opCode) NoDbgRegParms;
-static sqInt concretizeSqrtRd(AbstractInstruction * self_in_concretizeSqrtRd) NoDbgRegParms;
-static sqInt concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR) NoDbgRegParms;
-static sqInt concretizeSubCwR(AbstractInstruction * self_in_concretizeSubCwR) NoDbgRegParms;
-static sqInt concretizeSubRR(AbstractInstruction * self_in_concretizeSubRR) NoDbgRegParms;
-static sqInt concretizeXCHGAwR(AbstractInstruction * self_in_concretizeXCHGAwR) NoDbgRegParms;
-static sqInt concretizeXCHGMwrR(AbstractInstruction * self_in_concretizeXCHGMwrR) NoDbgRegParms;
-static sqInt concretizeXCHGRR(AbstractInstruction * self_in_concretizeXCHGRR) NoDbgRegParms;
-static sqInt concretizeXorCwR(AbstractInstruction * self_in_concretizeXorCwR) NoDbgRegParms;
-static sqInt concretizeXorRR(AbstractInstruction * self_in_concretizeXorRR) NoDbgRegParms;
static sqInt cResultRegister(AbstractInstruction * self_in_cResultRegister) NoDbgRegParms;
static void dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) NoDbgRegParms;
static AbstractInstruction * genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder) NoDbgRegParms;
@@ -495,8 +421,6 @@
static AbstractInstruction * generateLowLevelTryLock(AbstractInstruction * self_in_generateLowLevelTryLock, sqInt vmOwnerLockAddress) NoDbgRegParms;
static AbstractInstruction * generateLowLevelUnlock(AbstractInstruction * self_in_generateLowLevelUnlock, sqInt vmOwnerLockAddress) NoDbgRegParms;
static AbstractInstruction * genGetLeafCallStackPointerFunction(AbstractInstruction * self_in_genGetLeafCallStackPointerFunction) NoDbgRegParms;
-static AbstractInstruction * genJumpFPEqual(AbstractInstruction * self_in_genJumpFPEqual, void *jumpTarget) NoDbgRegParms;
-static AbstractInstruction * genJumpFPNotEqual(AbstractInstruction * self_in_genJumpFPNotEqual, void *jumpTarget) NoDbgRegParms;
static sqInt genLoadCStackPointer(AbstractInstruction * self_in_genLoadCStackPointer) NoDbgRegParms;
static sqInt genLoadCStackPointers(AbstractInstruction * self_in_genLoadCStackPointers) NoDbgRegParms;
static sqInt genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) NoDbgRegParms;
@@ -645,12 +569,9 @@
static sqInt followMethodReferencesInClosedPIC(CogMethod *cPIC) NoDbgRegParms;
static void freePICsWithFreedTargets(void);
void freeUnmarkedMachineCode(void);
-static void (*genCallEnilopmartForandcalled(sqInt regArg1, sqInt regArg2, char *trampolineName))(void) NoDbgRegParms;
-static void (*genCallEnilopmartForcalled(sqInt regArg1, char *trampolineName))(void) NoDbgRegParms;
static sqInt genCheckForInterruptsTrampoline(void);
-static void (*genEnilopmartForandandcalled(sqInt regArg1, sqInt regArg2, sqInt regArg3, char *trampolineName))(void) NoDbgRegParms;
-static void (*genEnilopmartForandcalled(sqInt regArg1, sqInt regArg2, char *trampolineName))(void) NoDbgRegParms;
-static void (*genEnilopmartForcalled(sqInt regArg1, char *trampolineName))(void) NoDbgRegParms;
+static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2, sqInt regArg3, sqInt forCall, sqInt trampolineName))(void) NoDbgRegParms;
+static void genEnilopmartReturn(sqInt forCall) NoDbgRegParms;
static void generateCaptureCStackPointers(sqInt captureFramePointer) NoDbgRegParms;
static void generateClosedPICPrototype(void);
static CogMethod * generateCogMethod(sqInt selector) NoDbgRegParms;
@@ -666,12 +587,12 @@
static sqInt genInnerPICAbortTrampoline(char *name) NoDbgRegParms;
static sqInt genLoadCStackPointersForPrimCall(void);
static sqInt genNonLocalReturnTrampoline(void);
+static sqInt genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) NoDbgRegParms;
static sqInt genSafeTrampolineForcalled(void *aRoutine, char *aString) NoDbgRegParms;
static sqInt genSafeTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) NoDbgRegParms;
static sqInt genSafeTrampolineForcalledargarg(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1) NoDbgRegParms;
static sqInt genSmalltalkToCStackSwitch(void);
static sqInt genTrampolineForcalled(void *aRoutine, char *aString) NoDbgRegParms;
-static sqInt genTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) NoDbgRegParms;
static sqInt genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg) NoDbgRegParms;
static sqInt genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg) NoDbgRegParms;
static sqInt genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg) NoDbgRegParms;
@@ -1170,6 +1091,7 @@
static sqInt v3PushNilSize(sqInt aMethodObj) NoDbgRegParms;
static sqInt v3NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
static sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop) NoDbgRegParms;
+static sqInt oopisGreaterThanOrEqualToandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop) NoDbgRegParms;
static sqInt oopisGreaterThan(sqInt anOop, sqInt otherOop) NoDbgRegParms;
static sqInt oopisLessThan(sqInt anOop, sqInt otherOop) NoDbgRegParms;
@@ -2002,40 +1924,7 @@
return null;
}
-
-/* Since it's an extraction from other methods. */
-
static sqInt
-computeJumpTargetOffsetPlus(AbstractInstruction * self_in_computeJumpTargetOffsetPlus, sqInt anPCOffset)
-{
- AbstractInstruction *jumpTarget;
- AbstractInstruction *jumpTarget1;
-
- /* begin jumpTargetAddress */
- jumpTarget1 = ((AbstractInstruction *) (((self_in_computeJumpTargetOffsetPlus->operands))[0]));
- assertSaneJumpTarget(jumpTarget1);
- if (isAnInstruction(self_in_computeJumpTargetOffsetPlus, jumpTarget1)) {
- jumpTarget1 = ((AbstractInstruction *) ((jumpTarget1->address)));
- }
- assert(jumpTarget1 != 0);
- jumpTarget = jumpTarget1;
- return (((sqInt) jumpTarget)) - (((sqInt) (((self_in_computeJumpTargetOffsetPlus->address)) + anPCOffset)));
-}
-
-static sqInt
-concretizeLabel(AbstractInstruction * self_in_concretizeLabel)
-{
- AbstractInstruction *dependentChain;
-
- dependentChain = (self_in_concretizeLabel->dependent);
- while (!(dependentChain == null)) {
- updateLabel(dependentChain, self_in_concretizeLabel);
- dependentChain = (dependentChain->dependent);
- }
- return ((self_in_concretizeLabel->machineCodeSize) = 0);
-}
-
-static sqInt
genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment)
{
sqInt delta;
@@ -2063,30 +1952,6 @@
}
static AbstractInstruction *
-genJumpFPGreaterOrEqual(AbstractInstruction * self_in_genJumpFPGreaterOrEqual, void *jumpTarget)
-{
- return genoperand(JumpFPGreaterOrEqual, ((sqInt)jumpTarget));
-}
-
-static AbstractInstruction *
-genJumpFPGreater(AbstractInstruction * self_in_genJumpFPGreater, void *jumpTarget)
-{
- return genoperand(JumpFPGreater, ((sqInt)jumpTarget));
-}
-
-static AbstractInstruction *
-genJumpFPLessOrEqual(AbstractInstruction * self_in_genJumpFPLessOrEqual, void *jumpTarget)
-{
- return genoperand(JumpFPLessOrEqual, ((sqInt)jumpTarget));
-}
-
-static AbstractInstruction *
-genJumpFPLess(AbstractInstruction * self_in_genJumpFPLess, void *jumpTarget)
-{
- return genoperand(JumpFPLess, ((sqInt)jumpTarget));
-}
-
-static AbstractInstruction *
genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister)
{
sqInt cResultReg;
@@ -2148,23 +2013,6 @@
}
-/* Since it's an extraction from other methods. */
-
-static AbstractInstruction *
-jumpTargetAddress(AbstractInstruction * self_in_jumpTargetAddress)
-{
- AbstractInstruction *jumpTarget;
-
- jumpTarget = ((AbstractInstruction *) (((self_in_jumpTargetAddress->operands))[0]));
- assertSaneJumpTarget(jumpTarget);
- if (isAnInstruction(self_in_jumpTargetAddress, jumpTarget)) {
- jumpTarget = ((AbstractInstruction *) ((jumpTarget->address)));
- }
- assert(jumpTarget != 0);
- return jumpTarget;
-}
-
-
/* 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.
@@ -2177,26 +2025,6 @@
}
-/* Since it's an extraction from other methods. */
-/* This needs to be digfferent from jumpTargetAddress because long jumps can
- be to absolute addresses and hence we can't assert that the jump target is
- sane.
- */
-
-static AbstractInstruction *
-longJumpTargetAddress(AbstractInstruction * self_in_longJumpTargetAddress)
-{
- AbstractInstruction *jumpTarget;
-
- jumpTarget = ((AbstractInstruction *) (((self_in_longJumpTargetAddress->operands))[0]));
- if (isAnInstruction(self_in_longJumpTargetAddress, jumpTarget)) {
- jumpTarget = ((AbstractInstruction *) ((jumpTarget->address)));
- }
- assert(jumpTarget != 0);
- return jumpTarget;
-}
-
-
/* If the processor has the ablity to generate code to flush the icache
answer the number of opcodes required to compile an accessor for the
feature.
@@ -2258,6 +2086,17 @@
return self_in_updateLabel;
}
+
+/* A hack hook to allow ARM to override the simulated address for the
+ short-cut trampolines
+ */
+
+static sqInt
+wantsNearAddressFor(AbstractInstruction * self_in_wantsNearAddressFor, sqInt anObject)
+{
+ return 0;
+}
+
static CogMethod *
cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod)
{
@@ -2662,233 +2501,6 @@
}
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeAddCqR(AbstractInstruction * self_in_concretizeAddCqR)
-{
- sqInt reg;
- unsigned long value;
-
- value = ((self_in_concretizeAddCqR->operands))[0];
- reg = concreteRegister(self_in_concretizeAddCqR, ((self_in_concretizeAddCqR->operands))[1]);
- if (isQuick(self_in_concretizeAddCqR, value)) {
- ((self_in_concretizeAddCqR->machineCode))[0] = 131;
- ((self_in_concretizeAddCqR->machineCode))[1] = (modRMRO(self_in_concretizeAddCqR, ModReg, reg, 0));
- ((self_in_concretizeAddCqR->machineCode))[2] = (value & 0xFF);
- return ((self_in_concretizeAddCqR->machineCodeSize) = 3);
- }
- if (reg == EAX) {
- ((self_in_concretizeAddCqR->machineCode))[0] = 5;
- ((self_in_concretizeAddCqR->machineCode))[1] = (value & 0xFF);
- ((self_in_concretizeAddCqR->machineCode))[2] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeAddCqR->machineCode))[3] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeAddCqR->machineCode))[4] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeAddCqR->machineCodeSize) = 5);
- }
- ((self_in_concretizeAddCqR->machineCode))[0] = 129;
- ((self_in_concretizeAddCqR->machineCode))[1] = (modRMRO(self_in_concretizeAddCqR, ModReg, reg, 0));
- ((self_in_concretizeAddCqR->machineCode))[2] = (value & 0xFF);
- ((self_in_concretizeAddCqR->machineCode))[3] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeAddCqR->machineCode))[4] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeAddCqR->machineCode))[5] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeAddCqR->machineCodeSize) = 6);
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeAddCwR(AbstractInstruction * self_in_concretizeAddCwR)
-{
- sqInt reg;
- unsigned long value;
-
- value = ((self_in_concretizeAddCwR->operands))[0];
- reg = concreteRegister(self_in_concretizeAddCwR, ((self_in_concretizeAddCwR->operands))[1]);
- if (reg == EAX) {
- ((self_in_concretizeAddCwR->machineCode))[0] = 5;
- ((self_in_concretizeAddCwR->machineCode))[1] = (value & 0xFF);
- ((self_in_concretizeAddCwR->machineCode))[2] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeAddCwR->machineCode))[3] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeAddCwR->machineCode))[4] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeAddCwR->machineCodeSize) = 5);
- }
- ((self_in_concretizeAddCwR->machineCode))[0] = 129;
- ((self_in_concretizeAddCwR->machineCode))[1] = (modRMRO(self_in_concretizeAddCwR, ModReg, reg, 0));
- ((self_in_concretizeAddCwR->machineCode))[2] = (value & 0xFF);
- ((self_in_concretizeAddCwR->machineCode))[3] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeAddCwR->machineCode))[4] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeAddCwR->machineCode))[5] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeAddCwR->machineCodeSize) = 6);
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeAddRR(AbstractInstruction * self_in_concretizeAddRR)
-{
- sqInt regLHS;
- sqInt regRHS;
-
- regLHS = concreteRegister(self_in_concretizeAddRR, ((self_in_concretizeAddRR->operands))[0]);
- regRHS = concreteRegister(self_in_concretizeAddRR, ((self_in_concretizeAddRR->operands))[1]);
- ((self_in_concretizeAddRR->machineCode))[0] = 3;
- ((self_in_concretizeAddRR->machineCode))[1] = (modRMRO(self_in_concretizeAddRR, ModReg, regLHS, regRHS));
- return ((self_in_concretizeAddRR->machineCodeSize) = 2);
-}
-
-static AbstractInstruction *
-concretizeAlignmentNops(AbstractInstruction * self_in_concretizeAlignmentNops)
-{
- sqInt i;
-
- flag("if performance is an issue generate longer nops");
- for (i = 0; i < ((self_in_concretizeAlignmentNops->machineCodeSize)); i += 1) {
- ((self_in_concretizeAlignmentNops->machineCode))[i] = 144;
- }
- return self_in_concretizeAlignmentNops;
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeAndCqR(AbstractInstruction * self_in_concretizeAndCqR)
-{
- unsigned long mask;
- sqInt reg;
-
- mask = ((self_in_concretizeAndCqR->operands))[0];
- reg = concreteRegister(self_in_concretizeAndCqR, ((self_in_concretizeAndCqR->operands))[1]);
- if (isQuick(self_in_concretizeAndCqR, mask)) {
- ((self_in_concretizeAndCqR->machineCode))[0] = 131;
- ((self_in_concretizeAndCqR->machineCode))[1] = (modRMRO(self_in_concretizeAndCqR, ModReg, reg, 4));
- ((self_in_concretizeAndCqR->machineCode))[2] = (mask & 0xFF);
- return ((self_in_concretizeAndCqR->machineCodeSize) = 3);
- }
- if (reg == EAX) {
- ((self_in_concretizeAndCqR->machineCode))[0] = 37;
- ((self_in_concretizeAndCqR->machineCode))[1] = (mask & 0xFF);
- ((self_in_concretizeAndCqR->machineCode))[2] = ((((usqInt) mask) >> 8) & 0xFF);
- ((self_in_concretizeAndCqR->machineCode))[3] = ((((usqInt) mask) >> 16) & 0xFF);
- ((self_in_concretizeAndCqR->machineCode))[4] = ((((usqInt) mask) >> 24) & 0xFF);
- return ((self_in_concretizeAndCqR->machineCodeSize) = 5);
- }
- ((self_in_concretizeAndCqR->machineCode))[0] = 129;
- ((self_in_concretizeAndCqR->machineCode))[1] = (modRMRO(self_in_concretizeAndCqR, ModReg, reg, 4));
- ((self_in_concretizeAndCqR->machineCode))[2] = (mask & 0xFF);
- ((self_in_concretizeAndCqR->machineCode))[3] = ((((usqInt) mask) >> 8) & 0xFF);
- ((self_in_concretizeAndCqR->machineCode))[4] = ((((usqInt) mask) >> 16) & 0xFF);
- ((self_in_concretizeAndCqR->machineCode))[5] = ((((usqInt) mask) >> 24) & 0xFF);
- return ((self_in_concretizeAndCqR->machineCodeSize) = 6);
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeAndCwR(AbstractInstruction * self_in_concretizeAndCwR)
-{
- sqInt reg;
- unsigned long value;
-
- value = ((self_in_concretizeAndCwR->operands))[0];
- reg = concreteRegister(self_in_concretizeAndCwR, ((self_in_concretizeAndCwR->operands))[1]);
- if (reg == EAX) {
- ((self_in_concretizeAndCwR->machineCode))[0] = 37;
- ((self_in_concretizeAndCwR->machineCode))[1] = (value & 0xFF);
- ((self_in_concretizeAndCwR->machineCode))[2] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeAndCwR->machineCode))[3] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeAndCwR->machineCode))[4] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeAndCwR->machineCodeSize) = 5);
- }
- ((self_in_concretizeAndCwR->machineCode))[0] = 131;
- ((self_in_concretizeAndCwR->machineCode))[1] = (modRMRO(self_in_concretizeAndCwR, ModReg, reg, 4));
- ((self_in_concretizeAndCwR->machineCode))[2] = (value & 0xFF);
- ((self_in_concretizeAndCwR->machineCode))[3] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeAndCwR->machineCode))[4] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeAndCwR->machineCode))[5] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeAndCwR->machineCodeSize) = 6);
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeAndRR(AbstractInstruction * self_in_concretizeAndRR)
-{
- sqInt regLHS;
- sqInt regRHS;
-
- regLHS = concreteRegister(self_in_concretizeAndRR, ((self_in_concretizeAndRR->operands))[0]);
- regRHS = concreteRegister(self_in_concretizeAndRR, ((self_in_concretizeAndRR->operands))[1]);
- ((self_in_concretizeAndRR->machineCode))[0] = 35;
- ((self_in_concretizeAndRR->machineCode))[1] = (modRMRO(self_in_concretizeAndRR, ModReg, regLHS, regRHS));
- return ((self_in_concretizeAndRR->machineCodeSize) = 2);
-}
-
-static sqInt
-concretizeArithmeticShiftRightCqR(AbstractInstruction * self_in_concretizeArithmeticShiftRightCqR)
-{
- sqInt reg;
- sqInt shiftCount;
-
- shiftCount = (((((self_in_concretizeArithmeticShiftRightCqR->operands))[0]) < 0x1F) ? (((self_in_concretizeArithmeticShiftRightCqR->operands))[0]) : 0x1F);
- reg = concreteRegister(self_in_concretizeArithmeticShiftRightCqR, ((self_in_concretizeArithmeticShiftRightCqR->operands))[1]);
- if (shiftCount == 1) {
- ((self_in_concretizeArithmeticShiftRightCqR->machineCode))[0] = 209;
- ((self_in_concretizeArithmeticShiftRightCqR->machineCode))[1] = (modRMRO(self_in_concretizeArithmeticShiftRightCqR, ModReg, reg, 7));
- return ((self_in_concretizeArithmeticShiftRightCqR->machineCodeSize) = 2);
- }
- ((self_in_concretizeArithmeticShiftRightCqR->machineCode))[0] = 193;
- ((self_in_concretizeArithmeticShiftRightCqR->machineCode))[1] = (modRMRO(self_in_concretizeArithmeticShiftRightCqR, ModReg, reg, 7));
- ((self_in_concretizeArithmeticShiftRightCqR->machineCode))[2] = shiftCount;
- return ((self_in_concretizeArithmeticShiftRightCqR->machineCodeSize) = 3);
-}
-
-
-/* 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. */
-
-static sqInt
-concretizeArithmeticShiftRightRR(AbstractInstruction * self_in_concretizeArithmeticShiftRightRR)
-{
- sqInt destReg;
- sqInt regToShift;
- sqInt shiftCountReg;
-
- shiftCountReg = concreteRegister(self_in_concretizeArithmeticShiftRightRR, ((self_in_concretizeArithmeticShiftRightRR->operands))[0]);
- destReg = concreteRegister(self_in_concretizeArithmeticShiftRightRR, ((self_in_concretizeArithmeticShiftRightRR->operands))[1]);
- if (shiftCountReg == ECX) {
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[0] = 211;
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[1] = (modRMRO(self_in_concretizeArithmeticShiftRightRR, ModReg, destReg, 7));
- return ((self_in_concretizeArithmeticShiftRightRR->machineCodeSize) = 2);
- }
- regToShift = (destReg == shiftCountReg
- ? ECX
- : (destReg == ECX
- ? shiftCountReg
- : destReg));
- if (shiftCountReg == EAX) {
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[0] = (144 + ECX);
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[1] = 211;
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[2] = (modRMRO(self_in_concretizeArithmeticShiftRightRR, ModReg, regToShift, 7));
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[3] = (144 + ECX);
- return ((self_in_concretizeArithmeticShiftRightRR->machineCodeSize) = 4);
- }
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[0] = 135;
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[1] = (modRMRO(self_in_concretizeArithmeticShiftRightRR, ModReg, ECX, shiftCountReg));
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[2] = 211;
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[3] = (modRMRO(self_in_concretizeArithmeticShiftRightRR, ModReg, regToShift, 7));
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[4] = 135;
- ((self_in_concretizeArithmeticShiftRightRR->machineCode))[5] = (modRMRO(self_in_concretizeArithmeticShiftRightRR, ModReg, ECX, shiftCountReg));
- return ((self_in_concretizeArithmeticShiftRightRR->machineCodeSize) = 6);
-}
-
-
/* Generate concrete machine code for the instruction at actualAddress,
setting machineCodeSize, and answer the following address. */
@@ -2902,324 +2514,7 @@
return actualAddress + ((self_in_concretizeAt->machineCodeSize));
}
-
-/* Will get inlined into concretizeAt: switch. */
-
static sqInt
-concretizeCall(AbstractInstruction * self_in_concretizeCall)
-{
- sqInt offset;
-
- assert((((self_in_concretizeCall->operands))[0]) != 0);
- offset = (((sqInt) (((self_in_concretizeCall->operands))[0]))) - (((sqInt) (((self_in_concretizeCall->address)) + 5)));
- ((self_in_concretizeCall->machineCode))[0] = 232;
- ((self_in_concretizeCall->machineCode))[1] = (offset & 0xFF);
- ((self_in_concretizeCall->machineCode))[2] = ((((usqInt) offset) >> 8) & 0xFF);
- ((self_in_concretizeCall->machineCode))[3] = ((((usqInt) offset) >> 16) & 0xFF);
- ((self_in_concretizeCall->machineCode))[4] = ((((usqInt) offset) >> 24) & 0xFF);
- return ((self_in_concretizeCall->machineCodeSize) = 5);
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeCDQ(AbstractInstruction * self_in_concretizeCDQ)
-{
- ((self_in_concretizeCDQ->machineCode))[0] = 153;
- return ((self_in_concretizeCDQ->machineCodeSize) = 1);
-}
-
-static sqInt
-concretizeCMPXCHGAwR(AbstractInstruction * self_in_concretizeCMPXCHGAwR)
-{
- unsigned long addressOperand;
- sqInt reg;
-
- addressOperand = ((self_in_concretizeCMPXCHGAwR->operands))[0];
- reg = concreteRegister(self_in_concretizeCMPXCHGAwR, ((self_in_concretizeCMPXCHGAwR->operands))[1]);
- ((self_in_concretizeCMPXCHGAwR->machineCode))[0] = 15;
- ((self_in_concretizeCMPXCHGAwR->machineCode))[1] = 177;
- ((self_in_concretizeCMPXCHGAwR->machineCode))[2] = (modRMRO(self_in_concretizeCMPXCHGAwR, ModRegInd, 5, reg));
- ((self_in_concretizeCMPXCHGAwR->machineCode))[3] = (addressOperand & 0xFF);
- ((self_in_concretizeCMPXCHGAwR->machineCode))[4] = ((((usqInt) addressOperand) >> 8) & 0xFF);
- ((self_in_concretizeCMPXCHGAwR->machineCode))[5] = ((((usqInt) addressOperand) >> 16) & 0xFF);
- ((self_in_concretizeCMPXCHGAwR->machineCode))[6] = ((((usqInt) addressOperand) >> 24) & 0xFF);
- return ((self_in_concretizeCMPXCHGAwR->machineCodeSize) = 7);
-}
-
-static sqInt
-concretizeCMPXCHGMwrR(AbstractInstruction * self_in_concretizeCMPXCHGMwrR)
-{
- sqInt destReg;
- unsigned long offset;
- sqInt srcReg;
-
- offset = ((self_in_concretizeCMPXCHGMwrR->operands))[0];
- srcReg = concreteRegister(self_in_concretizeCMPXCHGMwrR, ((self_in_concretizeCMPXCHGMwrR->operands))[1]);
- destReg = concreteRegister(self_in_concretizeCMPXCHGMwrR, ((self_in_concretizeCMPXCHGMwrR->operands))[2]);
- if (srcReg != ESP) {
- if (isQuick(self_in_concretizeCMPXCHGMwrR, offset)) {
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[0] = 15;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[1] = 177;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[2] = (modRMRO(self_in_concretizeCMPXCHGMwrR, ModRegRegDisp8, srcReg, destReg));
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[3] = (offset & 0xFF);
- return ((self_in_concretizeCMPXCHGMwrR->machineCodeSize) = 4);
- }
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[0] = 15;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[1] = 177;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[2] = (modRMRO(self_in_concretizeCMPXCHGMwrR, ModRegRegDisp32, srcReg, destReg));
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[3] = (offset & 0xFF);
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[4] = ((((usqInt) offset) >> 8) & 0xFF);
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[5] = ((((usqInt) offset) >> 16) & 0xFF);
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[6] = ((((usqInt) offset) >> 24) & 0xFF);
- return ((self_in_concretizeCMPXCHGMwrR->machineCodeSize) = 7);
- }
- if (isQuick(self_in_concretizeCMPXCHGMwrR, offset)) {
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[0] = 15;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[1] = 177;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[2] = (modRMRO(self_in_concretizeCMPXCHGMwrR, ModRegRegDisp8, srcReg, destReg));
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[3] = (sib(self_in_concretizeCMPXCHGMwrR, SIB1, 4, srcReg));
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[4] = (offset & 0xFF);
- return ((self_in_concretizeCMPXCHGMwrR->machineCodeSize) = 5);
- }
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[0] = 15;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[1] = 177;
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[2] = (modRMRO(self_in_concretizeCMPXCHGMwrR, ModRegRegDisp32, srcReg, destReg));
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[3] = (sib(self_in_concretizeCMPXCHGMwrR, SIB1, 4, srcReg));
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[4] = (offset & 0xFF);
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[5] = ((((usqInt) offset) >> 8) & 0xFF);
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[6] = ((((usqInt) offset) >> 16) & 0xFF);
- ((self_in_concretizeCMPXCHGMwrR->machineCode))[7] = ((((usqInt) offset) >> 24) & 0xFF);
- return ((self_in_concretizeCMPXCHGMwrR->machineCodeSize) = 8);
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeCmpCqR(AbstractInstruction * self_in_concretizeCmpCqR)
-{
- sqInt reg;
- unsigned long value;
-
- value = ((self_in_concretizeCmpCqR->operands))[0];
- reg = concreteRegister(self_in_concretizeCmpCqR, ((self_in_concretizeCmpCqR->operands))[1]);
- if (isQuick(self_in_concretizeCmpCqR, value)) {
- ((self_in_concretizeCmpCqR->machineCode))[0] = 131;
- ((self_in_concretizeCmpCqR->machineCode))[1] = (modRMRO(self_in_concretizeCmpCqR, ModReg, reg, 7));
- ((self_in_concretizeCmpCqR->machineCode))[2] = (value & 0xFF);
- return ((self_in_concretizeCmpCqR->machineCodeSize) = 3);
- }
- if (reg == EAX) {
- ((self_in_concretizeCmpCqR->machineCode))[0] = 61;
- ((self_in_concretizeCmpCqR->machineCode))[1] = (value & 0xFF);
- ((self_in_concretizeCmpCqR->machineCode))[2] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeCmpCqR->machineCode))[3] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeCmpCqR->machineCode))[4] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeCmpCqR->machineCodeSize) = 5);
- }
- ((self_in_concretizeCmpCqR->machineCode))[0] = 129;
- ((self_in_concretizeCmpCqR->machineCode))[1] = (modRMRO(self_in_concretizeCmpCqR, ModReg, reg, 7));
- ((self_in_concretizeCmpCqR->machineCode))[2] = (value & 0xFF);
- ((self_in_concretizeCmpCqR->machineCode))[3] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeCmpCqR->machineCode))[4] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeCmpCqR->machineCode))[5] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeCmpCqR->machineCodeSize) = 6);
-}
-
-
-/* Will get inlined into concretizeAt: switch. */
-
-static sqInt
-concretizeCmpCwR(AbstractInstruction * self_in_concretizeCmpCwR)
-{
- sqInt reg;
- unsigned long value;
-
- value = ((self_in_concretizeCmpCwR->operands))[0];
- reg = concreteRegister(self_in_concretizeCmpCwR, ((self_in_concretizeCmpCwR->operands))[1]);
- if (reg == EAX) {
- ((self_in_concretizeCmpCwR->machineCode))[0] = 61;
- ((self_in_concretizeCmpCwR->machineCode))[1] = (value & 0xFF);
- ((self_in_concretizeCmpCwR->machineCode))[2] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeCmpCwR->machineCode))[3] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeCmpCwR->machineCode))[4] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeCmpCwR->machineCodeSize) = 5);
- }
- ((self_in_concretizeCmpCwR->machineCode))[0] = 129;
- ((self_in_concretizeCmpCwR->machineCode))[1] = (modRMRO(self_in_concretizeCmpCwR, ModReg, reg, 7));
- ((self_in_concretizeCmpCwR->machineCode))[2] = (value & 0xFF);
- ((self_in_concretizeCmpCwR->machineCode))[3] = ((((usqInt) value) >> 8) & 0xFF);
- ((self_in_concretizeCmpCwR->machineCode))[4] = ((((usqInt) value) >> 16) & 0xFF);
- ((self_in_concretizeCmpCwR->machineCode))[5] = ((((usqInt) value) >> 24) & 0xFF);
- return ((self_in_concretizeCmpCwR->machineCodeSize) = 6);
-}
-
-
-/* Will get inlined into concretizeAt: switch.
- We use UCOMISD (see p 4-260 [2]) */
-/* CmpRR RHS LHS computes LHS - RHS, i.e. apparently reversed. You have to
- think subtract. */
-
-static sqInt
-concretizeCmpRdRd(AbstractInstruction * self_in_concretizeCmpRdRd)
-{
- sqInt regLHS;
- sqInt regRHS;
-
- regRHS = concreteDPFPRegister(self_in_concretizeCmpRdRd, ((self_in_concretizeCmpRdRd->operands))[0]);
- regLHS = concreteDPFPRegister(self_in_concretizeCmpRdRd, ((self_in_concretizeCmpRdRd->operands))[1]);
- ((self_in_concretizeCmpRdRd->machineCode))[0] = 102;
- ((self_in_concretizeCmpRdRd->machineCode))[1] = 15;
- ((self_in_concretizeCmpRdRd->machineCode))[2] = 46;
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list