[Vm-dev] [commit][3034] CogVM source as per VMMaker.oscog-eem.808
commits at squeakvm.org
commits at squeakvm.org
Mon Jul 7 21:05:53 UTC 2014
Revision: 3034
Author: eliot
Date: 2014-07-07 14:05:51 -0700 (Mon, 07 Jul 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.808
Change implementation of the implicit receiver trampoline to cache the class
tag, not the class object (thanks Ryan). Has a significant impact on Newspeak
Spur performance. Refactor getInlineCacheClassTagFrom:into: into
genGetInlineCacheClassTagFrom:into:forEntry: and add inlineCacheTagForClass:
to support this.
Change the V3 inline cache check to not shift the compact class index (thanks
Tim). Saves a byte and an instruction from the entry sequence on x86.
Issue a prefetch for Sista counters after frame build.
Make genSmallIntegerComparison:orDoubleComparison:
observe hasDoublePrecisionFloatingPointSupport (for ARM).
Finally rename ClassInteger to ClassSmallInteger.
Modified Paths:
--------------
branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c
branches/Cog/nscogsrc/vm/cogit.c
branches/Cog/nscogsrc/vm/cogit.h
branches/Cog/nscogsrc/vm/cogmethod.h
branches/Cog/nscogsrc/vm/cointerp.c
branches/Cog/nscogsrc/vm/cointerp.h
branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
branches/Cog/nscogsrc/vm/interp.h
branches/Cog/nscogsrc/vm/vmCallback.h
branches/Cog/nsspursrc/vm/cogit.c
branches/Cog/nsspursrc/vm/cogit.h
branches/Cog/nsspursrc/vm/cogmethod.h
branches/Cog/nsspursrc/vm/cointerp.c
branches/Cog/nsspursrc/vm/cointerp.h
branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
branches/Cog/nsspursrc/vm/interp.h
branches/Cog/nsspursrc/vm/vmCallback.h
branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
branches/Cog/nsspurstacksrc/vm/interp.c
branches/Cog/nsspurstacksrc/vm/interp.h
branches/Cog/nsspurstacksrc/vm/vmCallback.h
branches/Cog/sistasrc/vm/cogit.c
branches/Cog/sistasrc/vm/cogit.h
branches/Cog/sistasrc/vm/cogmethod.h
branches/Cog/sistasrc/vm/cointerp.c
branches/Cog/sistasrc/vm/cointerp.h
branches/Cog/sistasrc/vm/gcc3x-cointerp.c
branches/Cog/sistasrc/vm/interp.h
branches/Cog/sistasrc/vm/vmCallback.h
branches/Cog/spursistasrc/vm/cogit.c
branches/Cog/spursistasrc/vm/cogit.h
branches/Cog/spursistasrc/vm/cogmethod.h
branches/Cog/spursistasrc/vm/cointerp.c
branches/Cog/spursistasrc/vm/cointerp.h
branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursistasrc/vm/interp.h
branches/Cog/spursistasrc/vm/vmCallback.h
branches/Cog/spursrc/vm/cogit.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cogmethod.h
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/interp.h
branches/Cog/spursrc/vm/vmCallback.h
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/spurstacksrc/vm/interp.h
branches/Cog/spurstacksrc/vm/vmCallback.h
branches/Cog/src/plugins/IA32ABI/IA32ABI.c
branches/Cog/src/vm/cogit.c
branches/Cog/src/vm/cogit.h
branches/Cog/src/vm/cogmethod.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/src/vm/interp.h
branches/Cog/src/vm/vmCallback.h
branches/Cog/stacksrc/vm/gcc3x-interp.c
branches/Cog/stacksrc/vm/interp.c
branches/Cog/stacksrc/vm/interp.h
branches/Cog/stacksrc/vm/vmCallback.h
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c
===================================================================
--- branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c 2014-07-06 17:42:23 UTC (rev 3033)
+++ branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c 2014-07-07 21:05:51 UTC (rev 3034)
@@ -1,9 +1,9 @@
/* Automatically generated by
- VMPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
+ VMPluginCodeGenerator VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
from
- NewsqueakIA32ABIPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
+ NewsqueakIA32ABIPlugin VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
*/
-static char __buildInfo[] = "NewsqueakIA32ABIPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211 " __DATE__ ;
+static char __buildInfo[] = "NewsqueakIA32ABIPlugin VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636 " __DATE__ ;
@@ -220,9 +220,9 @@
struct VirtualMachine* interpreterProxy;
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
- "IA32ABI VMMaker.oscog-eem.787 (i)"
+ "IA32ABI VMMaker.oscog-eem.808 (i)"
#else
- "IA32ABI VMMaker.oscog-eem.787 (e)"
+ "IA32ABI VMMaker.oscog-eem.808 (e)"
#endif
;
@@ -1407,7 +1407,7 @@
sqInt valueOop;
rcvr = stackValue(0);
- value = longAt(rcvr + BaseHeaderSize);
+ value = ((sqInt) (longAt(rcvr + BaseHeaderSize)));
valueOop = signed32BitIntegerFor(value);
return methodReturnValue(valueOop);
}
@@ -1435,7 +1435,7 @@
if (isOopImmutable(rcvr)) {
return primitiveFailFor(PrimErrNoModification);
}
- longAtput(rcvr + BaseHeaderSize, value);
+ longAtput(rcvr + BaseHeaderSize, ((usqInt) value));
return methodReturnValue(valueOop);
}
Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c 2014-07-06 17:42:23 UTC (rev 3033)
+++ branches/Cog/nscogsrc/vm/cogit.c 2014-07-07 21:05:51 UTC (rev 3034)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.805 uuid: 33a04610-ba5b-471e-847a-597e2045be6e
+ CCodeGenerator VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.805 uuid: 33a04610-ba5b-471e-847a-597e2045be6e
+ StackToRegisterMappingCogit VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.805 uuid: 33a04610-ba5b-471e-847a-597e2045be6e " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -112,26 +112,26 @@
/*** Constants ***/
-#define AddCqR 90
-#define AddCwR 97
-#define AddRdRd 104
-#define AddRR 83
+#define AddCqR 91
+#define AddCwR 98
+#define AddRdRd 105
+#define AddRR 84
#define AlignmentNops 2
#define AllButTypeMask 0xFFFFFFFCUL
#define AltBlockCreationBytecodeSize 3
#define AltNSSendIsPCAnnotated 0
-#define AndCqR 92
-#define AndCwR 99
-#define AndRR 85
+#define AndCqR 93
+#define AndCwR 100
+#define AndRR 86
#define AnnotationShift 5
#define Arg0Reg -7
#define Arg1Reg -8
-#define ArithmeticShiftRightCqR 76
-#define ArithmeticShiftRightRR 77
+#define ArithmeticShiftRightCqR 77
+#define ArithmeticShiftRightRR 78
#define BadRegisterSet 1
#define BlockCreationBytecodeSize 4
#define Call 9
-#define CDQ 110
+#define CDQ 111
#define ClassMethodContextCompactIndex 14
#define ClassReg -5
#define ClosureFirstCopiedValueIndex 3
@@ -144,20 +144,20 @@
#define CMMaxUsageCount 7
#define CMMethod 2
#define CMOpenPIC 5
-#define CMPXCHGAwR 118
-#define CMPXCHGMwrR 119
-#define CmpCqR 89
-#define CmpCwR 96
-#define CmpRdRd 103
-#define CmpRR 82
+#define CMPXCHGAwR 119
+#define CMPXCHGMwrR 120
+#define CmpCqR 90
+#define CmpCwR 97
+#define CmpRdRd 104
+#define CmpRR 83
#define CompactClasses 28
#define ConstZero 1
-#define ConvertRRd 109
-#define CPUID 113
+#define ConvertRRd 110
+#define CPUID 114
#define Debug DEBUGVM
#define DisplacementMask 0x1F
#define DisplacementX2N 32
-#define DivRdRd 107
+#define DivRdRd 108
#define DPFPReg0 -9
#define DPFPReg1 -10
#define DPFPReg2 -11
@@ -198,8 +198,8 @@
#define HeaderIndex 0
#define HeaderTypeShort 3
#define HeaderTypeSizeAndClass 0
-#define IDIVR 111
-#define IMULRR 112
+#define IDIVR 112
+#define IMULRR 113
#define InstanceSpecificationIndex 2
#define InstructionPointerIndex 1
#define InsufficientCodeSpace -2
@@ -240,14 +240,14 @@
#define JumpZero 16
#define Label 1
#define LastJump 39
-#define LFENCE 114
+#define LFENCE 115
#define LinkReg -17
-#define LOCK 117
-#define LoadEffectiveAddressMwrR 73
-#define LogicalShiftLeftCqR 80
-#define LogicalShiftLeftRR 81
-#define LogicalShiftRightCqR 78
-#define LogicalShiftRightRR 79
+#define LOCK 118
+#define LoadEffectiveAddressMwrR 74
+#define LogicalShiftLeftCqR 81
+#define LogicalShiftLeftRR 82
+#define LogicalShiftRightCqR 79
+#define LogicalShiftRightRR 80
#define LongSizeMask 0xFFFFFFFCUL
#define MapEnd 0
#define MaxCompiledPrimitiveIndex 222
@@ -264,7 +264,7 @@
#define MethodCacheSelector 1
#define MethodIndex 3
#define MethodTooBig -4
-#define MFENCE 115
+#define MFENCE 116
#define MFMethodFlagHasContextFlag 1
#define MFMethodFlagIsBlockFlag 2
#define ModReg 3
@@ -272,25 +272,25 @@
#define ModRegRegDisp32 2
#define ModRegRegDisp8 1
#define MoveAwR 41
-#define MoveCqR 62
-#define MoveCwR 63
-#define MoveM16rR 50
-#define MoveM64rRd 67
-#define MoveMbrR 58
-#define MoveMwrR 44
+#define MoveCqR 63
+#define MoveCwR 64
+#define MoveM16rR 51
+#define MoveM64rRd 68
+#define MoveMbrR 59
+#define MoveMwrR 45
#define MoveRAw 42
-#define MoveRdM64r 68
-#define MoveRdRd 66
-#define MoveRMbr 59
-#define MoveRMwr 45
+#define MoveRdM64r 69
+#define MoveRdRd 67
+#define MoveRMbr 60
+#define MoveRMwr 46
#define MoveRR 40
-#define MoveRXbrR 61
-#define MoveRXwrR 47
-#define MoveXbrRR 60
-#define MoveXwrRR 46
+#define MoveRXbrR 62
+#define MoveRXwrR 48
+#define MoveXbrRR 61
+#define MoveXwrRR 47
#define MULTIPLEBYTECODESETS 1
-#define MulRdRd 106
-#define NegateR 75
+#define MulRdRd 107
+#define NegateR 76
#define NewspeakVM 1
#define Nop 8
#define NotFullyInitialized -1
@@ -298,20 +298,20 @@
#define NumObjRefsInRuntime 2
#define NumSendTrampolines 4
#define NumTrampolines 60
-#define OrCqR 93
-#define OrCwR 100
-#define OrRR 86
+#define OrCqR 94
+#define OrCwR 101
+#define OrRR 87
#define PCReg -18
-#define PopR 69
-#define PrefetchAw 72
+#define PopR 70
+#define PrefetchAw 73
#define PrimCallCollectsProfileSamples 8
#define PrimCallDoNotJIT 32
#define PrimCallMayCallBack 4
#define PrimCallNeedsNewMethod 1
#define PrimCallNeedsPrimitiveFunction 2
#define PrimErrWritePastObject 17
-#define PushCw 71
-#define PushR 70
+#define PushCw 72
+#define PushR 71
#define ReceiverIndex 5
#define ReceiverResultReg -3
#define RetN 10
@@ -321,7 +321,7 @@
#define SelectorDoesNotUnderstand 20
#define SenderIndex 0
#define SendNumArgsReg -6
-#define SFENCE 116
+#define SFENCE 117
#define ShiftForWord 2
#define ShouldNotJIT -8
#define SIB1 0
@@ -329,22 +329,22 @@
#define Size4Bit 0
#define SizeMask 0xFC
#define SPReg -2
-#define SqrtRd 108
+#define SqrtRd 109
#define SSBaseOffset 1
#define SSConstant 2
#define SSRegister 3
#define SSSpill 4
-#define SubCqR 91
-#define SubCwR 98
-#define SubRdRd 105
-#define SubRR 84
+#define SubCqR 92
+#define SubCwR 99
+#define SubRdRd 106
+#define SubRR 85
#define TempReg -4
#define TypeMask 0x3
#define UnimplementedPrimitive -7
#define ValueIndex 1
-#define XCHGAwR 120
-#define XCHGMwrR 121
-#define XCHGRR 122
+#define XCHGAwR 121
+#define XCHGMwrR 122
+#define XCHGRR 123
#define XMM0L 0
#define XMM1L 2
#define XMM2L 4
@@ -353,8 +353,8 @@
#define XMM5L 10
#define XMM6L 12
#define XMM7L 14
-#define XorCwR 101
-#define XorRR 87
+#define XorCwR 102
+#define XorRR 88
#define YoungSelectorInPIC -5
@@ -577,7 +577,7 @@
void callCogCodePopReceiver(void);
void callCogCodePopReceiverAndClassRegs(void);
sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver);
-static sqInt ceImplicitReceiverForreceiverclass(sqInt selector, sqInt receiver, sqInt rcvrClass) NoDbgRegParms;
+static sqInt ceImplicitReceiverForreceiver(sqInt selector, sqInt receiver) NoDbgRegParms;
sqInt ceSICMiss(sqInt receiver);
void checkAssertsEnabledInCogit(void);
static sqInt checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) NoDbgRegParms;
@@ -823,6 +823,7 @@
sqInt canLinkToYoungClasses(void);
static sqInt checkValidInlineCacheTag(sqInt cacheTag) NoDbgRegParms;
static sqInt checkValidOopReference(sqInt anOop) NoDbgRegParms;
+static sqInt compactClassFieldMask(void);
static sqInt couldBeObject(sqInt oop) NoDbgRegParms;
static sqInt genActiveContextTrampoline(void);
static sqInt genAddSmallIntegerTagsTo(sqInt aRegister) NoDbgRegParms;
@@ -841,6 +842,7 @@
static sqInt genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg) NoDbgRegParms;
static sqInt genGetFixedFieldsOfPointerNonIntintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg) NoDbgRegParms;
static sqInt genGetHashFieldNonImmOfasSmallIntegerInto(sqInt instReg, sqInt destReg) NoDbgRegParms;
+static AbstractInstruction * genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt forEntry) NoDbgRegParms;
static sqInt genInnerPrimitiveAt(sqInt retNoffset) NoDbgRegParms;
static sqInt genInnerPrimitiveIdenticalorNotIf(sqInt retNoffset, sqInt orNot) NoDbgRegParms;
static sqInt genInnerPrimitiveIdentityHash(sqInt retNOffset) NoDbgRegParms;
@@ -857,7 +859,7 @@
static sqInt genStoreImmediateInSourceRegslotIndexdestReg(sqInt sourceReg, sqInt index, sqInt destReg) NoDbgRegParms;
static sqInt genStoreSourceRegslotIndexdestRegscratchReg(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg) NoDbgRegParms;
static sqInt genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg) NoDbgRegParms;
-static AbstractInstruction * getInlineCacheClassTagFrominto(sqInt sourceReg, sqInt destReg) NoDbgRegParms;
+static sqInt inlineCacheTagForClass(sqInt classOop) NoDbgRegParms;
static sqInt inlineCacheTagForInstance(sqInt oop) NoDbgRegParms;
static sqInt inlineCacheTagIsYoung(sqInt cacheTag) NoDbgRegParms;
static sqInt inlineCacheTagsMayBeObjects(void);
@@ -1071,6 +1073,7 @@
static sqInt genSendTrampolineFornumArgscalledargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2) NoDbgRegParms;
static sqInt genSendTrampolineFornumArgscalledargargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3) NoDbgRegParms;
static sqInt genSendnumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
+static sqInt genSmallIntegerComparison(sqInt jumpOpcode) NoDbgRegParms;
static sqInt genSmallIntegerComparisonorDoubleComparison(sqInt jumpOpcode, AbstractInstruction *(*jumpFPOpcodeGenerator)(void *)) NoDbgRegParms;
static sqInt genSpecialSelectorArithmetic(void);
static sqInt genSpecialSelectorClass(void);
@@ -8845,27 +8848,29 @@
The trampoline has already fetched the class and probed the cache and
found that the cache missed. Compute the implicit receiver for the
receiver's class
- and reload the class. If either the class or the mixin are young the
- method needs
- to be added to the youngReferrers list to ensure correct GC. */
+ and reload the class tag. If either the class tag or the mixin are young
+ then the
+ method needs to be added to the youngReferrers list to ensure correct GC. */
static sqInt
-ceImplicitReceiverForreceiverclass(sqInt selector, sqInt receiver, sqInt rcvrClass)
+ceImplicitReceiverForreceiver(sqInt selector, sqInt receiver)
{
sqInt classpc;
CogMethod *cogMethod;
sqInt mixin;
sqInt mixinpc;
+ sqInt rcvrClass;
sqInt retpc;
retpc = stackTop();
classpc = retpc + (jumpShortByteSize(backEnd));
mixinpc = (retpc + (jumpShortByteSize(backEnd))) + BytesPerOop;
- assert(rcvrClass != (unalignedLongAt(backEnd, classpc)));
mixin = implicitReceiverFormixinimplementing(receiver, mMethodClass(), selector);
+ rcvrClass = fetchClassOf(receiver);
cogMethod = mframeHomeMethodExport();
if (!((cogMethod->cmRefersToYoung))) {
- if ((isYoung(rcvrClass))
+ if (((inlineCacheTagsMayBeObjects())
+ && (isYoung(rcvrClass)))
|| ((mixin != receiver)
&& (isYoung(mixin)))) {
if (!(roomOnYoungReferrersList())) {
@@ -8876,7 +8881,7 @@
addToYoungReferrers(cogMethod);
}
}
- unalignedLongAtput(backEnd, classpc, rcvrClass);
+ unalignedLongAtput(backEnd, classpc, inlineCacheTagForClass(rcvrClass));
unalignedLongAtput(backEnd, mixinpc, (mixin == receiver
? 0
: mixin));
@@ -10107,7 +10112,7 @@
/* begin Nop */
dynSuperEntry = gen(Nop);
- entry = getInlineCacheClassTagFrominto(ReceiverResultReg, TempReg);
+ entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1);
/* begin CmpR:R: */
genoperandoperand(CmpRR, ClassReg, TempReg);
/* begin JumpNonZero: */
@@ -10189,7 +10194,7 @@
/* begin Nop */
dynSuperEntry = gen(Nop);
- entry = getInlineCacheClassTagFrominto(ReceiverResultReg, TempReg);
+ entry = genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, TempReg, 1);
/* begin CmpR:R: */
genoperandoperand(CmpRR, ClassReg, TempReg);
/* begin JumpNonZero: */
@@ -11282,15 +11287,16 @@
Lclass: .word
Lmixin:: .word
continue:
- If class matches class of receiver then mixin contains either 0 or the implicit receiver.
+ If class tag matches class of receiver then mixin contains either 0 or the implicit receiver.
If 0, answer the actual receiver, otherwise the mixin.
- Generate the class fetch and cache probe inline for speed. Smashes Arg0Reg and caller-saved regs. */
+ Generate the class fetch and cache probe inline for speed.
+ Smashes Arg1Reg, RegClass and caller-saved regs. */
ceExplicitReceiverTrampoline = genTrampolineForcalledargresult(ceExplicitReceiverAt, "ceExplicitReceiverTrampoline", SendNumArgsReg, ReceiverResultReg);
opcodeIndex = 0;
/* begin MoveMw:r:R: */
genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, ReceiverResultReg);
- genGetClassObjectOfintoscratchReginstRegIsReceiver(ReceiverResultReg, ClassReg, TempReg, 1);
+ genGetInlineCacheClassTagFromintoforEntry(ReceiverResultReg, ClassReg, 0);
/* begin MoveMw:r:R: */
genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg);
/* begin MoveMw:r:R: */
@@ -11311,7 +11317,7 @@
genoperandoperand(MoveRR, ClassReg, ReceiverResultReg);
jmpTarget(jumpItsTheReceiverStupid, gRetN(0));
jmpTarget(jumpMiss, gLabel());
- ceImplicitReceiverTrampoline = genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceImplicitReceiverForreceiverclass, "ceImplicitReceiverTrampoline", 3, SendNumArgsReg, ReceiverResultReg, ClassReg, null, 0, 1, ReceiverResultReg, 1);
+ ceImplicitReceiverTrampoline = genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceImplicitReceiverForreceiver, "ceImplicitReceiverTrampoline", 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 1, ReceiverResultReg, 1);
}
@@ -12948,7 +12954,6 @@
mixinpc = ((((sqInt)mcpc)) + (jumpShortByteSize(backEnd))) + BytesPerOop;
class = unalignedLongAt(backEnd, classpc);
if (class != 0) {
- assert(addressCouldBeObj(class));
if (cacheTagIsMarked(class)) {
if (((mixin = unalignedLongAt(backEnd, mixinpc))) != 0) {
markAndTraceLiteral(mixin);
@@ -13020,7 +13025,6 @@
mixinpc = ((((sqInt)mcpc)) + (jumpShortByteSize(backEnd))) + BytesPerOop;
class = unalignedLongAt(backEnd, classpc);
if (class != 0) {
- assert(addressCouldBeObj(class));
if (cacheTagIsMarked(class)) {
if (((mixin = unalignedLongAt(backEnd, mixinpc))) != 0) {
markAndTraceLiteral(mixin);
@@ -13124,6 +13128,7 @@
if (entryPoint1 == ceImplicitReceiverTrampoline) {
if (((class = unalignedLongAt(backEnd, (((sqInt)mcpc)) + (jumpShortByteSize(backEnd))))) != 0) {
markAndTraceLiteralIfYoung(class);
+
mixin = unalignedLongAt(backEnd, ((((sqInt)mcpc)) + (jumpShortByteSize(backEnd))) + BytesPerOop);
markAndTraceLiteralIfYoung(mixin);
}
@@ -13970,16 +13975,25 @@
}
}
if (entryPoint1 == ceImplicitReceiverTrampoline) {
+
+ /* Examine an implicit receiver cache. */
+
pc = (((sqInt)mcpc)) + (jumpShortByteSize(backEnd));
if (((oop = unalignedLongAt(backEnd, pc))) != 0) {
- mappedOop = remapOop(oop);
- if (mappedOop != oop) {
- unalignedLongAtput(backEnd, pc, mappedOop);
+
+ /* First look at the classTag entry. This is an inline cache tag and so might not be an object. */
+
+ if ((inlineCacheTagsMayBeObjects())
+ && (couldBeObject(oop))) {
+ mappedOop = remapOop(oop);
+ if (mappedOop != oop) {
+ unalignedLongAtput(backEnd, pc, mappedOop);
+ }
+ if ((hasYoungPtr != 0)
+ && (isYoung(mappedOop))) {
+ (((sqInt *) hasYoungPtr))[0] = 1;
+ }
}
- if ((hasYoungPtr != 0)
- && (isYoung(mappedOop))) {
- (((sqInt *) hasYoungPtr))[0] = 1;
- }
pc = ((((sqInt)mcpc)) + (jumpShortByteSize(backEnd))) + BytesPerOop;
if (((oop = unalignedLongAt(backEnd, pc))) != 0) {
mappedOop = remapOop(oop);
@@ -14859,7 +14873,9 @@
freeMethod(CogMethod *cogMethod)
{
assert(((cogMethod->cmType)) != CMFree);
- assert((cogMethodDoesntLookKosher(cogMethod)) == 0);
+ 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
@@ -15516,7 +15532,7 @@
checkValidInlineCacheTag(sqInt cacheTag)
{
return (((cacheTag & ((1 << ShiftForWord) - 1)) == 0)
- && (((cacheTag >= (1 << ShiftForWord)) && (cacheTag <= ((compactClassIndexOfHeader(-1)) << ShiftForWord)))))
+ && (((cacheTag >= (1 << (compactClassFieldLSB()))) && (cacheTag <= ((compactClassIndexOfHeader(-1)) << (compactClassFieldLSB()))))))
|| (checkValidObjectReference(cacheTag));
}
@@ -15528,6 +15544,17 @@
}
+/* This is the mask for the field when shifted into the least significant
+ bits
+ */
+
+static sqInt
+compactClassFieldMask(void)
+{
+ return (1 << (compactClassFieldWidth())) - 1;
+}
+
+
/* Note this version filters-out compact class indices via the >= nilObj
clause
*/
@@ -15879,6 +15906,60 @@
}
+/* 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, or the receiver's
+ classIndex. The inline cache tag for a given object is the value loaded in
+ inline caches to distinguish
+ objects of different classes. In SqueakV3 the tag is the integer tag bit
+ for SmallIntegers (1),
+ the compact class index shifted by log: 2 word size for objects with
+ compact classes
+ (1 * 4 to: 31 * 4 by: 4), or the class. These ranges cannot overlap
+ because the heap
+ (and hence the lowest class object) is beyond the machine code zone.
+ If forEntry is true answer the entry label at which control is to enter
+ (cmEntryOffset). If forEntry is false, control enters at the start. */
+
+static AbstractInstruction *
+genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt forEntry)
+{
+ AbstractInstruction *entryLabel;
+ AbstractInstruction *jumpCompact;
+ AbstractInstruction *jumpIsInt;
+ sqInt offset;
+ sqInt quickConstant;
+
+ /* begin AlignmentNops: */
+ genoperand(AlignmentNops, ((BytesPerWord < 8) ? 8 : BytesPerWord));
+ /* begin Label */
+ entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, sourceReg, destReg);
+ /* begin AndCq:R: */
+ genoperandoperand(AndCqR, 1, destReg);
+ /* begin JumpNonZero: */
+ jumpIsInt = genoperand(JumpNonZero, ((sqInt)0));
+ /* begin MoveMw:r:R: */
+ genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg);
+ assert(((compactClassFieldMask()) << (compactClassFieldLSB())) < (nilObject()));
+ /* begin AndCq:R: */
+ quickConstant = ((1 << (compactClassFieldWidth())) - 1) << (compactClassFieldLSB());
+ genoperandoperand(AndCqR, quickConstant, destReg);
+ /* begin JumpNonZero: */
+ jumpCompact = genoperand(JumpNonZero, ((sqInt)0));
+ /* begin MoveMw:r:R: */
+ offset = classFieldOffset();
+ genoperandoperandoperand(MoveMwrR, offset, sourceReg, destReg);
+ /* begin AndCq:R: */
+ genoperandoperand(AndCqR, ((sqInt) AllButTypeMask), destReg);
+ jmpTarget(jumpCompact, jmpTarget(jumpIsInt, gLabel()));
+ return entryLabel;
+}
+
+
/* c.f. StackInterpreter>>stSizeOf: lengthOf:baseHeader:format:
fixedFieldsOf:format:length:
*/
@@ -16458,58 +16539,26 @@
}
-/* 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 SqueakV3 the tag is the integer tag bit for
- SmallIntegers (1),
- the compact class index shifted by log: 2 word size for objects with
- compact classes
- (1 * 4 to: 31 * 4 by: 4), or the class. These ranges cannot overlap
- because the heap
- (and hence the lowest class object) is beyond the machine code zone. */
+/* Answer the relevant inline cache tag for a class.
+ c.f. inlineCacheTagForInstance: */
-static AbstractInstruction *
-getInlineCacheClassTagFrominto(sqInt sourceReg, sqInt destReg)
+static sqInt
+inlineCacheTagForClass(sqInt classOop)
{
- AbstractInstruction *entryLabel;
- AbstractInstruction *jumpCompact;
- AbstractInstruction *jumpIsInt;
- sqInt offset;
- sqInt quickConstant;
- sqInt quickConstant1;
+ sqInt cci;
- /* begin AlignmentNops: */
- genoperand(AlignmentNops, ((BytesPerWord < 8) ? 8 : BytesPerWord));
- /* begin Label */
- entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
- /* begin MoveR:R: */
- genoperandoperand(MoveRR, sourceReg, destReg);
- /* begin AndCq:R: */
- genoperandoperand(AndCqR, 1, destReg);
- /* begin JumpNonZero: */
- jumpIsInt = genoperand(JumpNonZero, ((sqInt)0));
- /* begin MoveMw:r:R: */
- genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg);
- /* begin LogicalShiftRightCq:R: */
- quickConstant = (compactClassFieldLSB()) - ShiftForWord;
- genoperandoperand(LogicalShiftRightCqR, quickConstant, destReg);
- /* begin AndCq:R: */
- quickConstant1 = ((1 << (compactClassFieldWidth())) - 1) << ShiftForWord;
- genoperandoperand(AndCqR, quickConstant1, destReg);
- /* begin JumpNonZero: */
- jumpCompact = genoperand(JumpNonZero, ((sqInt)0));
- /* begin MoveMw:r:R: */
- offset = classFieldOffset();
- genoperandoperandoperand(MoveMwrR, offset, sourceReg, destReg);
- /* begin AndCq:R: */
- genoperandoperand(AndCqR, ((sqInt) AllButTypeMask), destReg);
- jmpTarget(jumpCompact, jmpTarget(jumpIsInt, gLabel()));
- return entryLabel;
+ if (classOop == (classSmallInteger())) {
+ return ((0 << 1) | 1);
+ }
+ if (((cci = noShiftCompactClassIndexOfHeader(formatOfClass(classOop)))) > 0) {
+ return cci;
+ }
+ return classOop;
}
-/* c.f. getInlineCacheClassTagFrom:into: */
+/* Answer the relevant inline cache tag for an instance.
+ c.f. getInlineCacheClassTagFrom:into: & inlineCacheTagForClass: */
static sqInt
inlineCacheTagForInstance(sqInt oop)
@@ -16519,8 +16568,8 @@
if ((oop & 1)) {
return ((0 << 1) | 1);
}
- if (((cci = compactClassIndexOf(oop))) > 0) {
- return cci << ShiftForWord;
+ if (((cci = noShiftCompactClassIndexOf(oop))) > 0) {
+ return cci;
}
return (classHeader(oop)) & AllButTypeMask;
}
@@ -20959,7 +21008,29 @@
return genMarshalledSendnumArgs(selector, numArgs);
}
+static sqInt
+genSmallIntegerComparison(sqInt jumpOpcode)
+{
+ AbstractInstruction *jumpFail;
+ AbstractInstruction *jumpTrue;
+ /* begin MoveR:R: */
+ genoperandoperand(MoveRR, Arg0Reg, TempReg);
+ jumpFail = genJumpNotSmallIntegerInScratchReg(TempReg);
+ /* begin CmpR:R: */
+ genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
+ jumpTrue = gen(jumpOpcode);
+ annotateobjRef(gMoveCwR(falseObject(), ReceiverResultReg), falseObject());
+ /* begin RetN: */
+ genoperand(RetN, 0);
+ jmpTarget(jumpTrue, annotateobjRef(gMoveCwR(trueObject(), ReceiverResultReg), trueObject()));
+ /* begin RetN: */
+ genoperand(RetN, 0);
+ jmpTarget(jumpFail, gLabel());
+ return 0;
+}
+
+
/* Stack looks like
return address */
@@ -20973,6 +21044,9 @@
AbstractInstruction *jumpTrue;
sqInt quickConstant;
+ if (!(hasDoublePrecisionFloatingPointSupport(backEnd))) {
+ return genSmallIntegerComparison(jumpOpcode);
+ }
/* begin MoveR:R: */
genoperandoperand(MoveRR, Arg0Reg, TempReg);
jumpDouble = genJumpNotSmallIntegerInScratchReg(TempReg);
Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h 2014-07-06 17:42:23 UTC (rev 3033)
+++ branches/Cog/nscogsrc/vm/cogit.h 2014-07-07 21:05:51 UTC (rev 3034)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.805 uuid: 33a04610-ba5b-471e-847a-597e2045be6e
+ CCodeGenerator VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
*/
Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h 2014-07-06 17:42:23 UTC (rev 3033)
+++ branches/Cog/nscogsrc/vm/cogmethod.h 2014-07-07 21:05:51 UTC (rev 3034)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.805 uuid: 33a04610-ba5b-471e-847a-597e2045be6e
+ CCodeGenerator VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
*/
typedef struct {
Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2014-07-06 17:42:23 UTC (rev 3033)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2014-07-07 21:05:51 UTC (rev 3034)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.804 uuid: 8f232d31-fa50-4134-8556-da8fc12ab32d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
from
- CoInterpreter VMMaker.oscog-eem.804 uuid: 8f232d31-fa50-4134-8556-da8fc12ab32d
+ CoInterpreter VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.804 uuid: 8f232d31-fa50-4134-8556-da8fc12ab32d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.808 uuid: 84bdf081-a2e8-4c84-b249-b140228e6636 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -144,7 +144,6 @@
#define ClassExternalStructure 44
#define ClassFloat 9
#define ClassFloatCompactIndex 6
-#define ClassInteger 5
#define ClassLargeNegativeInteger 42
#define ClassLargeNegativeIntegerCompactIndex 4
#define ClassLargePositiveInteger 13
@@ -156,6 +155,7 @@
#define ClassMutex 39
#define ClassPoint 12
#define ClassSemaphore 18
+#define ClassSmallInteger 5
#define ClassUnsafeAlien 54
#define ClosureCopiedValuesIndex 3
#define ClosureFirstCopiedValueIndex 3
@@ -775,6 +775,7 @@
static sqInt copyObjtoSegmentaddrstopAtsaveOopAtheaderAt(sqInt oop, sqInt segmentWordArray, sqInt lastSeg, sqInt stopAddr, sqInt oopPtr, sqInt hdrPtr) NoDbgRegParms;
usqInt freeStartAddress(void);
sqInt isReallyYoungObject(sqInt obj);
+sqInt noShiftCompactClassIndexOf(sqInt oop);
sqInt nullHeaderForMachineCodeMethod(void);
usqInt scavengeThresholdAddress(void);
sqInt withoutForwardingOnandsendToCogit(sqInt obj1, sqInt obj2, sqInt (*selector)(sqInt,sqInt));
@@ -956,6 +957,7 @@
sqInt markAndTrace(sqInt oop);
sqInt maybeSplObj(sqInt index);
sqInt nilObject(void);
+sqInt noShiftCompactClassIndexOfHeader(sqInt header);
sqInt objectBefore(sqInt address);
sqInt objectExactlyBefore(sqInt oop);
sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop);
@@ -2064,7 +2066,7 @@
/* 574 */ (void (*)(void))0,
/* 575 */ (void (*)(void))0,
0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.804";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.808";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -2095,12 +2097,12 @@
#define stackPageAtpages(index,pages) ((pages) + (index))
#define startOfMemory() heapBase
#define classFieldOffset() (0 - BaseHeaderSize)
-#define compactClassFieldLSB() 12
#define compactClassFieldWidth() 5
#define freeStart() GIV(freeStart)
#define instFormatFieldLSB() 8
#define instFormatFieldWidth() 4
#define youngStart() GIV(youngStart)
+#define compactClassFieldLSB() 12
#define isForwarded(oop) false
#define memory() GIV(memory)
#define remapBufferCount() GIV(remapBufferCount)
@@ -4488,7 +4490,7 @@
else {
contextToReturnTo = longAt((home + BaseHeaderSize) + (SenderIndex << ShiftForWord));
if ((((contextToReturnTo & 1) == 0)
- && (((((usqInt) (longAt(contextToReturnTo))) >> 12) & 0x1F) == ClassMethodContextCompactIndex))
+ && (((((usqInt) (longAt(contextToReturnTo))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex))
&& (((longAt((contextToReturnTo + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))) {
assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, localFP));
/* begin frameOfMarriedContext: */
@@ -4747,7 +4749,7 @@
contextToReturnTo = callerContextOrNil;
freeStackPageNoAssert(GIV(stackPage));
retToContext = ((contextToReturnTo & 1) == 0)
- && (((((usqInt) (longAt(contextToReturnTo))) >> 12) & 0x1F) == ClassMethodContextCompactIndex);
+ && (((((usqInt) (longAt(contextToReturnTo))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex);
if (retToContext
&& ((((longAt((contextToReturnTo + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
&& (!(isWidowedContext(contextToReturnTo))))) {
@@ -4941,8 +4943,8 @@
rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
mClassMixin = methodClassOf(GIV(method));
mixinApplication = findApplicationOfTargetMixinstartingAtBehavior(mClassMixin, ((rcvr & 1)
- ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassInteger << ShiftForWord))
- : (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+ : (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))));
lkupClassTag = longAt((mixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
@@ -5154,8 +5156,8 @@
VM_LABEL(0normalSend);
rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
lkupClassTag = ((rcvr & 1)
- ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassInteger << ShiftForWord))
- : (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+ : (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
assert(lkupClassTag != (nilObject()));
@@ -5559,7 +5561,7 @@
/* begin pushMaybeContextReceiverVariable: */
rcvr = longAt(localFP + FoxIFReceiver);
if ((byte3 <= StackPointerIndex)
- && (((((usqInt) (longAt(rcvr))) >> 12) & 0x1F) == ClassMethodContextCompactIndex)) {
+ && (((((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)) {
/* begin internalPush: */
/* begin instVar:ofContext: */
VM_LABEL(0instVarofContext);
@@ -5759,7 +5761,7 @@
VM_LABEL(0storeMaybeContextReceiverVariablewithValue);
rcvr1 = longAt(localFP + FoxIFReceiver);
if ((byte3 <= ReceiverIndex)
- && ((((((usqInt) (longAt(rcvr1))) >> 12) & 0x1F) == ClassMethodContextCompactIndex)
+ && ((((((usqInt) (longAt(rcvr1))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)
&& (((longAt((rcvr1 + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1)))) {
/* begin instVar:ofContext:put: */
VM_LABEL(0instVarofContextput);
@@ -6506,7 +6508,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l18;
@@ -6543,7 +6545,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l21;
@@ -6642,7 +6644,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l27;
@@ -6679,7 +6681,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l30;
@@ -6774,7 +6776,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l36;
@@ -6811,7 +6813,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l39;
@@ -6953,7 +6955,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l45;
@@ -6990,7 +6992,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l48;
@@ -7121,7 +7123,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l54;
@@ -7158,7 +7160,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l57;
@@ -7247,7 +7249,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l63;
@@ -7284,7 +7286,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l66;
@@ -7369,7 +7371,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l72;
@@ -7406,7 +7408,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l75;
@@ -7491,7 +7493,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l81;
@@ -7528,7 +7530,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l84;
@@ -7625,7 +7627,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l90;
@@ -7662,7 +7664,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l93;
@@ -7770,7 +7772,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isFloat = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l99;
@@ -7807,7 +7809,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((arg & 1)));
- ccIndex1 = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(arg))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isFloat1 = ((longAt(arg - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << ShiftForWord)));
goto l102;
@@ -7932,7 +7934,7 @@
}
else {
if (!(((rcvr & 1) == 0)
- && (ClassFloatCompactIndex == ((((usqInt) (longAt(rcvr))) >> 12) & 0x1F)))) {
+ && (ClassFloatCompactIndex == ((((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)))) {
/* begin success: */
/* Don't overwrite an error code that has already been set. */
@@ -8282,7 +8284,7 @@
atIx = rcvr & AtCacheMask;
if ((GIV(atCache)[atIx + AtCacheOop]) != rcvr) {
- lkupClassTag = (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ lkupClassTag = (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)));
GIV(messageSelector) = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SpecialSelectors << ShiftForWord))) + BaseHeaderSize) + ((16 * 2) << ShiftForWord));
@@ -8298,7 +8300,7 @@
hdr = longAt(rcvr);
fmt = (((usqInt) hdr) >> (instFormatFieldLSB())) & 15;
if ((fmt == 3)
- && (((((usqInt) hdr) >> 12) & 0x1F) == ClassMethodContextCompactIndex)) {
+ && (((((usqInt) hdr) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)) {
/* Contexts must not be put in the atCache, since their size is not constant */
@@ -8332,7 +8334,7 @@
fixedFields = totalLength;
goto l119;
}
- class = (((ccIndex1 = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ class = (((ccIndex1 = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex1 - 1) << ShiftForWord)));
classFormat = (longAt((class + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) - 1;
@@ -8501,7 +8503,7 @@
atIx = (rcvr & AtCacheMask) + AtPutBase;
if ((GIV(atCache)[atIx + AtCacheOop]) != rcvr) {
- lkupClassTag = (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ lkupClassTag = (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)));
GIV(messageSelector) = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SpecialSelectors << ShiftForWord))) + BaseHeaderSize) + ((17 * 2) << ShiftForWord));
@@ -8517,7 +8519,7 @@
hdr = longAt(rcvr);
fmt = (((usqInt) hdr) >> (instFormatFieldLSB())) & 15;
if ((fmt == 3)
- && (((((usqInt) hdr) >> 12) & 0x1F) == ClassMethodContextCompactIndex)) {
+ && (((((usqInt) hdr) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)) {
/* Contexts must not be put in the atCache, since their size is not constant */
@@ -8551,7 +8553,7 @@
fixedFields = totalLength;
goto l129;
}
- class = (((ccIndex1 = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ class = (((ccIndex1 = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex1 - 1) << ShiftForWord)));
classFormat = (longAt((class + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) - 1;
@@ -8648,7 +8650,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((value & 1)));
- ccIndex3 = (((usqInt) (longAt(value))) >> 12) & 0x1F;
+ ccIndex3 = (((usqInt) (longAt(value))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex3 == 0) {
isCharacter = ((longAt(value - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)));
goto l133;
@@ -8742,7 +8744,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isString = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteString << ShiftForWord)));
goto l138;
@@ -8786,7 +8788,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex1 = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex1 = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex1 == 0) {
isArray = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << ShiftForWord)));
goto l139;
@@ -8891,8 +8893,8 @@
/* begin internalStackTopPut: */
aValue = ((rcvr & 1)
- ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassInteger << ShiftForWord))
- : (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+ : (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
longAtPointerput(localSP, aValue);
@@ -8929,7 +8931,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isBlock = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBlockClosure << ShiftForWord)));
goto l141;
@@ -8982,7 +8984,7 @@
}
/* begin isClassOfNonImm:equalTo:compactClassIndex: */
assert(!((rcvr & 1)));
- ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
+ ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F;
if (ccIndex == 0) {
isBlock = ((longAt(rcvr - BaseHeaderSize)) & AllButTypeMask) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBlockClosure << ShiftForWord)));
goto l143;
@@ -9066,7 +9068,7 @@
successBoolean = 0;
goto l145;
}
- cl = (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ cl = (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)));
successBoolean = cl == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << ShiftForWord)));
@@ -9112,7 +9114,7 @@
successBoolean = 0;
goto l147;
}
- cl = (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ cl = (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)));
successBoolean = cl == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << ShiftForWord)));
@@ -9183,8 +9185,8 @@
GIV(argumentCount) = 0;
rcvr = longAtPointer(localSP + (0 * BytesPerOop));
lkupClassTag = ((rcvr & 1)
- ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassInteger << ShiftForWord))
- : (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
+ ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+ : (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
assert(lkupClassTag != (nilObject()));
@@ -9235,8 +9237,8 @@
GIV(argumentCount) = 1;
rcvr = longAtPointer(localSP + (1 * BytesPerOop));
lkupClassTag = ((rcvr & 1)
- ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassInteger << ShiftForWord))
- : (((ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F)) == 0
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list