[Vm-dev] [commit][3281] CogVM source as per VMMaker.oscog-eem.1095
commits at squeakvm.org
commits at squeakvm.org
Wed Mar 18 01:13:56 UTC 2015
Revision: 3281
Author: eliot
Date: 2015-03-17 18:13:54 -0700 (Tue, 17 Mar 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1095
Fix assertClassOf:is: to handle immediates upstream of isClassOfNonImm:equalTo:.
Fixes a potential crash when x or y is sent to immediates (bytecodePrimX/Y).
Fix a spelling error with the schedule scavenge trampoline.
Modified Paths:
--------------
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/MiscPrimitivePlugin/MiscPrimitivePlugin.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/vm/cogit.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.c 2015-03-18 00:12:19 UTC (rev 3280)
+++ branches/Cog/nsspursrc/vm/cogit.c 2015-03-18 01:13:54 UTC (rev 3281)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CCodeGenerator VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -132,7 +132,7 @@
#define BadRegisterSet 1
#define BlockCreationBytecodeSize 4
#define Call 9
-#define CDQ 111
+#define CDQ 112
#define ClassArrayCompactIndex 51
#define ClassBlockClosureCompactIndex 37
#define ClassFloatCompactIndex 34
@@ -149,15 +149,15 @@
#define CMMaxUsageCount 7
#define CMMethod 2
#define CMOpenPIC 5
-#define CMPXCHGAwR 119
-#define CMPXCHGMwrR 120
+#define CMPXCHGAwR 120
+#define CMPXCHGMwrR 121
#define CmpCqR 90
#define CmpCwR 97
#define CmpRdRd 104
#define CmpRR 83
#define ConstZero 1
-#define ConvertRRd 110
-#define CPUID 114
+#define ConvertRRd 111
+#define CPUID 115
#define Debug DEBUGVM
#define DisplacementMask 0x1F
#define DisplacementX2N 32
@@ -199,8 +199,8 @@
#define GPRegMin -8
#define HasBytecodePC 5
#define HeaderIndex 0
-#define IDIVR 112
-#define IMULRR 113
+#define IDIVR 113
+#define IMULRR 114
#define InstanceSpecificationIndex 2
#define InstructionPointerIndex 1
#define InsufficientCodeSpace -2
@@ -242,9 +242,9 @@
#define Label 1
#define LargeContextSlots 62
#define LastJump 39
-#define LFENCE 115
+#define LFENCE 116
#define LinkReg -17
-#define LOCK 118
+#define LOCK 119
#define LoadEffectiveAddressMwrR 74
#define LogicalShiftLeftCqR 81
#define LogicalShiftLeftRR 82
@@ -265,7 +265,7 @@
#define MethodCacheSelector 1
#define MethodIndex 3
#define MethodTooBig -4
-#define MFENCE 116
+#define MFENCE 117
#define MFMethodFlagHasContextFlag 1
#define MFMethodFlagIsBlockFlag 2
#define ModReg 3
@@ -321,14 +321,14 @@
#define SelectorDoesNotUnderstand 20
#define SenderIndex 0
#define SendNumArgsReg -6
-#define SFENCE 117
+#define SFENCE 118
#define ShouldNotJIT -8
#define SIB1 0
#define SIB4 2
#define SistaVM 0
#define SmallContextSlots 22
#define SPReg -2
-#define SqrtRd 109
+#define SqrtRd 110
#define SSBaseOffset 1
#define SSConstant 2
#define SSRegister 3
@@ -341,9 +341,9 @@
#define TempReg -4
#define UnimplementedPrimitive -7
#define ValueIndex 1
-#define XCHGAwR 121
-#define XCHGMwrR 122
-#define XCHGRR 123
+#define XCHGAwR 122
+#define XCHGMwrR 123
+#define XCHGRR 124
#define XMM0L 0
#define XMM1L 2
#define XMM2L 4
@@ -666,7 +666,6 @@
static sqInt genInnerPICAbortTrampoline(char *name) NoDbgRegParms;
static sqInt genLoadCStackPointersForPrimCall(void);
static sqInt genNonLocalReturnTrampoline(void);
-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);
@@ -1128,7 +1127,7 @@
static void initSimStackForFramefulMethod(sqInt startpc) NoDbgRegParms;
static void initSimStackForFramelessBlock(sqInt startpc) NoDbgRegParms;
static void initSimStackForFramelessMethod(sqInt startpc) NoDbgRegParms;
-static usqInt liveRegisters(void);
+static sqInt liveRegisters(void);
static void marshallAbsentReceiverSendArguments(sqInt numArgs) NoDbgRegParms;
static void marshallSendArguments(sqInt numArgs) NoDbgRegParms;
static void mergeafterContinuation(BytecodeFixup *fixup, sqInt mergeWithContinuation) NoDbgRegParms;
@@ -1224,9 +1223,9 @@
static sqInt cePrimReturnEnterCogCode;
static sqInt cePrimReturnEnterCogCodeProfiling;
sqInt ceReturnToInterpreterTrampoline;
+static sqInt ceScheduleScavengeTrampoline;
static sqInt ceSendMustBeBooleanAddFalseTrampoline;
static sqInt ceSendMustBeBooleanAddTrueTrampoline;
-static sqInt ceSheduleScavengeTrampoline;
static sqInt ceSmallActiveContextInBlockTrampoline;
static sqInt ceSmallActiveContextInMethodTrampoline;
static sqInt ceStoreCheckTrampoline;
@@ -9959,7 +9958,9 @@
/* begin Label */
noCheckEntry = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
if (compileSendTrace()) {
+ ;
CallRT(ceTraceLinkedSendTrampoline);
+
}
}
@@ -10104,7 +10105,7 @@
{
AbstractInstruction *sendMissCall;
- allocateOpcodesbytecodes(20, 0);
+ allocateOpcodesbytecodes(24, 0);
methodOrBlockNumArgs = 0;
sendMissCall = compileAbort();
compileEntry();
@@ -11451,16 +11452,6 @@
}
-/* Generate a trampoline with no arguments that will
- save and restore all registers around the call */
-
-static sqInt
-genSafeTrampolineForcalled(void *aRoutine, char *aString)
-{
- return genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 0, null, null, null, null, 1, 1, null, 0);
-}
-
-
/* Generate a trampoline with one argument that will
save and restore all registers around the call */
@@ -15671,7 +15662,7 @@
jmpTarget(exit, gLabel());
/* begin RetN: */
genoperand(RetN, 0);
- jmpTarget(jumpNeedScavenge, CallRT(ceSheduleScavengeTrampoline));
+ jmpTarget(jumpNeedScavenge, CallRT(ceScheduleScavengeTrampoline));
/* begin Jump: */
genoperand(Jump, ((sqInt)continuation));
return 0;
@@ -17262,7 +17253,7 @@
genoperandoperand(CmpCqR, quickConstant2, TempReg);
/* begin JumpBelow: */
skip = genoperand(JumpBelow, ((sqInt)0));
- CallRT(ceSheduleScavengeTrampoline);
+ CallRT(ceScheduleScavengeTrampoline);
jmpTarget(skip, gLabel());
return 0;
}
@@ -17317,7 +17308,7 @@
genoperandoperand(CmpCqR, quickConstant2, TempReg);
/* begin JumpBelow: */
skip = genoperand(JumpBelow, ((sqInt)0));
- CallRT(ceSheduleScavengeTrampoline);
+ CallRT(ceScheduleScavengeTrampoline);
jmpTarget(skip, gLabel());
/* begin MoveR:Mw:r: */
genoperandoperandoperand(MoveRMwr, ClassReg, (ClosureOuterContextIndex * BytesPerOop) + BaseHeaderSize, ReceiverResultReg);
@@ -17676,7 +17667,7 @@
generateObjectRepresentationTrampolines(void)
{
ceStoreCheckTrampoline = genTrampolineForcalledargresult(remember, "ceStoreCheckTrampoline", ReceiverResultReg, returnRegForStoreCheck());
- ceSheduleScavengeTrampoline = genSafeTrampolineForcalled(ceSheduleScavenge, "ceSheduleScavengeTrampoline");
+ ceScheduleScavengeTrampoline = genTrampolineForcalled(ceScheduleScavenge, "ceScheduleScavengeTrampoline");
ceSmallActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, 0, "ceSmallMethodContext");
ceSmallActiveContextInBlockTrampoline = genActiveContextTrampolineLargeinBlockcalled(0, 1, "ceSmallBlockContext");
ceLargeActiveContextInMethodTrampoline = genActiveContextTrampolineLargeinBlockcalled(1, 0, "ceLargeMethodContext");
@@ -23794,11 +23785,11 @@
simSpillBase = (simStackPtr = methodOrBlockNumArgs - 1);
}
-static usqInt
+static sqInt
liveRegisters(void)
{
sqInt i;
- usqInt regsSet;
+ sqInt regsSet;
if (needsFrame) {
regsSet = 0;
@@ -24380,7 +24371,7 @@
{
sqInt i;
sqInt lastRequired;
- usqInt liveRegs;
+ sqInt liveRegs;
/* compute live regs while noting the last occurrence of required regs.
Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h 2015-03-18 00:12:19 UTC (rev 3280)
+++ branches/Cog/nsspursrc/vm/cogit.h 2015-03-18 01:13:54 UTC (rev 3281)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CCodeGenerator VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
*/
Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c 2015-03-18 00:12:19 UTC (rev 3280)
+++ branches/Cog/nsspursrc/vm/cointerp.c 2015-03-18 01:13:54 UTC (rev 3281)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
from
- CoInterpreter VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CoInterpreter VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -804,7 +804,7 @@
static sqInt addressIsInPage(StackPage * self_in_addressIsInPage, char *address) NoDbgRegParms;
static sqInt isFree(StackPage * self_in_isFree) NoDbgRegParms;
sqInt ceClassAtIndex(sqInt classIndex);
-void ceSheduleScavenge(void);
+void ceScheduleScavenge(void);
static void clearLeakMapAndMapAccessibleObjects(void);
void ensureNoForwardedLiteralsIn(sqInt aMethodObj);
usqInt freeStartAddress(void);
@@ -821,7 +821,6 @@
static sqInt addressAfter(sqInt objOop) NoDbgRegParms;
static sqInt allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex) NoDbgRegParms;
static sqInt allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex) NoDbgRegParms;
-static usqInt allocateSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex) NoDbgRegParms;
sqInt byteSwapped(sqInt w);
static usqInt bytesInObject(sqInt objOop) NoDbgRegParms;
static sqInt changeClassOfto(sqInt rcvr, sqInt argClass) NoDbgRegParms;
@@ -1171,7 +1170,7 @@
static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms;
sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-usqInt stringForCString(const char *aCString);
+sqInt stringForCString(const char *aCString);
static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
void tenuringIncrementalGC(void);
@@ -2366,7 +2365,7 @@
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1088";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1095";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -6898,7 +6897,7 @@
usqInt newObj;
usqInt numBytes;
sqInt popValues;
- sqInt size;
+ usqInt size;
VM_LABEL(pushNewArrayBytecode);
size = byteAtPointer(++localIP);
@@ -9844,6 +9843,7 @@
case 206:
/* bytecodePrimPointX */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointX);
@@ -9851,8 +9851,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -9879,6 +9885,7 @@
case 207:
/* bytecodePrimPointY */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointY);
@@ -9886,8 +9893,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -12353,6 +12366,7 @@
case 366: /*110*/
/* bytecodePrimPointX */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointX1);
@@ -12360,8 +12374,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -12388,6 +12408,7 @@
case 367: /*111*/
/* bytecodePrimPointY */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointY1);
@@ -12395,8 +12416,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -12830,7 +12857,7 @@
usqInt newObj;
usqInt numBytes;
sqInt popValues;
- sqInt size;
+ usqInt size;
VM_LABEL(pushNewArrayBytecode1);
size = byteAtPointer(++localIP);
@@ -14181,7 +14208,7 @@
CogMethod *cogMethod;
sqInt methodField;
sqInt methodField1;
- usqInt theIP;
+ sqInt theIP;
assertl(GIV(stackPage) == (mostRecentlyUsedPage()), ln);
assertl(addressIsInPage(GIV(stackPage), lifp), ln);
@@ -22067,7 +22094,7 @@
int index;
sqInt methodField;
usqInt numArgs;
- usqInt numTemps;
+ sqInt numTemps;
char *rcvrAddress;
sqInt rcvrOrClosure;
sqInt theMethod;
@@ -22100,7 +22127,7 @@
numArgs = (cogMethod->cmNumArgs);
/* begin temporaryCountOfMethodHeader: */
header = (homeMethod->methodHeader);
- numTemps = ((sqInt) ((((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F));
+ numTemps = (((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F;
}
else {
theMethod = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
@@ -22120,7 +22147,7 @@
assert((((((CogMethod *) header2))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
header1 = ((((CogMethod *) header2))->methodHeader);
}
- numTemps = ((sqInt) ((((usqInt) header1) >> MethodHeaderTempCountShift) & 0x3F));
+ numTemps = (((usqInt) header1) >> MethodHeaderTempCountShift) & 0x3F;
}
if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
@@ -22320,7 +22347,7 @@
/* begin printChar: */
putchar(' ');
if (((((usqInt) (longAt(s))) >> 24) & 0x1F) >= 16) {
- printf("%x %.*s\n", s, numBytesOf(s), (char *)firstIndexableField(s));
+ printf("%lx %.*s\n", s, numBytesOf(s), (char *)firstIndexableField(s));
}
else {
shortPrintOop(s);
@@ -29556,6 +29583,10 @@
primitiveClipboardText(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt fmt;
+ sqInt formatField;
+ usqInt newObj;
+ usqInt numBytes;
+ sqInt numSlots;
sqInt s;
char *sp;
sqInt sz;
@@ -29586,7 +29617,45 @@
/* begin allocateBytes:classIndex: */
assert(addressCouldBeClassObj(classAtIndex(ClassByteStringCompactIndex)));
assert((instSpecOfClass(classAtIndex(ClassByteStringCompactIndex))) == (firstByteFormat()));
- s = ((usqInt) (allocateSlotsformatclassIndex(((sz + BytesPerOop) - 1) / BytesPerOop, 16 + ((8 - sz) & (BytesPerWord - 1)), ClassByteStringCompactIndex)));
+ /* begin allocateSlots:format:classIndex: */
+ numSlots = ((sz + BytesPerOop) - 1) / BytesPerOop;
+ formatField = 16 + ((8 - sz) & (BytesPerWord - 1));
+ if (numSlots >= 0xFF) {
+ newObj = GIV(freeStart) + BaseHeaderSize;
+ numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop);
+ }
+ else {
+ newObj = GIV(freeStart);
+ numBytes = BaseHeaderSize + ((numSlots <= 1
+ ? 8
+ : (numSlots + (numSlots & 1)) * BytesPerOop));
+ }
+ if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
+ if (!GIV(needGCFlag)) {
+ /* begin scheduleScavenge */
+ GIV(needGCFlag) = 1;
+ forceInterruptCheck();
+ }
+ s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+ goto l1;
+ }
+ if (numSlots >= 0xFF) {
+
+ /* for header parsing we put a saturated slot count in the prepended overflow size word */
+
+ flag("endianness");
+ longAtput(GIV(freeStart), numSlots);
+ longAtput(GIV(freeStart) + 4, 0xFF << 24);
+ long64Atput(newObj, (((((usqLong) 0xFF)) << 56) + (formatField << 24)) + ClassByteStringCompactIndex);
+ }
+ else {
+ long64Atput(newObj, (((((usqLong) numSlots)) << 56) + (formatField << 24)) + ClassByteStringCompactIndex);
+ }
+ assert((numBytes % (allocationUnit())) == 0);
+ assert((newObj % (allocationUnit())) == 0);
+ GIV(freeStart) += numBytes;
+ s = newObj;
+ l1: /* end allocateSlots:format:classIndex: */;
if (!(s)) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
@@ -33334,6 +33403,7 @@
static void
primitiveImageName(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt ok;
sqInt okToRename;
sqInt s;
void *sCRIfn;
@@ -33358,8 +33428,14 @@
}
s = longAt(GIV(stackPointer));
/* begin assertClassOf:is: */
+ ok = (s & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(s));
+ ok = ((longAt(s)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteString << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(s)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteString << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -34784,7 +34860,7 @@
sqInt err;
sqInt hash;
sqInt instSpec;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
sqInt numSlots;
@@ -34899,7 +34975,7 @@
sqInt i;
sqInt instSpec;
sqInt literalCount;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
sqInt numSlots;
@@ -39210,6 +39286,7 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
long bufferSize;
sqInt numSamples;
+ sqInt ok;
sqInt oop;
sqInt running;
sqInt sampleBuffer;
@@ -39250,8 +39327,14 @@
sampleBuffer = oop;
l1: /* end stackObjectValue: */;
/* begin assertClassOf:is: */
+ ok = (sampleBuffer & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(sampleBuffer));
+ ok = ((longAt(sampleBuffer)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBitmap << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(sampleBuffer)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBitmap << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -39707,7 +39790,7 @@
}
void
-ceSheduleScavenge(void)
+ceScheduleScavenge(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
assert(GIV(freeStart) >= GIV(scavengeThreshold));
/* begin scheduleScavenge */
@@ -40308,59 +40391,6 @@
}
-/* Allocate an object with numSlots space. If there is room beneath
- scavengeThreshold allocate in newSpace, otherwise alocate in oldSpace. If
- there is not room in newSpace
- and a scavenge is not already scheduled, schedule a scavenge. */
-/* Object headers are 8 bytes in length if the slot size fits in the num
- slots field (max implies overflow),
- 16 bytes otherwise (num slots in preceeding word).
- Objects always have at least one slot, for the forwarding pointer,
- and are multiples of 8 bytes in length. */
-
-static usqInt
-allocateSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex)
-{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- usqInt newObj;
- usqInt numBytes;
-
- if (numSlots >= 0xFF) {
- newObj = GIV(freeStart) + BaseHeaderSize;
- numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop);
- }
- else {
- newObj = GIV(freeStart);
- numBytes = BaseHeaderSize + ((numSlots <= 1
- ? 8
- : (numSlots + (numSlots & 1)) * BytesPerOop));
- }
- if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
- if (!GIV(needGCFlag)) {
- /* begin scheduleScavenge */
- GIV(needGCFlag) = 1;
- forceInterruptCheck();
- }
- return allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, classIndex);
- }
- if (numSlots >= 0xFF) {
-
- /* for header parsing we put a saturated slot count in the prepended overflow size word */
-
- flag("endianness");
- longAtput(GIV(freeStart), numSlots);
- longAtput(GIV(freeStart) + 4, 0xFF << 24);
- long64Atput(newObj, (((((usqLong) 0xFF)) << 56) + (formatField << 24)) + classIndex);
- }
- else {
- long64Atput(newObj, (((((usqLong) numSlots)) << 56) + (formatField << 24)) + classIndex);
- }
- assert((numBytes % (allocationUnit())) == 0);
- assert((newObj % (allocationUnit())) == 0);
- GIV(freeStart) += numBytes;
- return newObj;
-}
-
-
/* Answer the given integer with its bytes in the reverse order. */
sqInt
@@ -40737,7 +40767,7 @@
sqInt fillValue;
sqInt hash;
sqInt instSpec;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
usqInt numSlots;
@@ -42606,7 +42636,7 @@
sqInt entry;
sqInt expectedIndex;
sqInt expectedIndex1;
- usqInt freeChunk;
+ sqInt freeChunk;
sqInt i;
sqInt i1;
sqInt index;
@@ -42645,8 +42675,8 @@
sqInt ptr1;
sqInt ptr2;
sqInt slotBytes;
- usqInt smallObj;
- usqInt start;
+ sqInt smallObj;
+ sqInt start;
classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
if (classIndex == 0) {
@@ -45580,7 +45610,7 @@
sqInt fmt;
sqInt hasYoung;
sqInt i;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
usqInt numSlots;
@@ -56706,13 +56736,13 @@
sqInt obj21;
sqInt pigBytes;
usqInt prevFree;
- sqInt prevFreeChunk;
+ usqInt prevFreeChunk;
usqInt prevPrevFree;
- sqInt prevPrevFreeChunk;
+ usqInt prevPrevFreeChunk;
sqInt slotBytes;
sqInt slotBytes1;
usqInt there;
- sqInt thisFreeChunk;
+ usqInt thisFreeChunk;
sqInt usedChunk;
sqInt valuePointer;
sqInt valuePointer1;
@@ -59792,8 +59822,8 @@
sqInt prevPrevObj;
sqInt prevPrevObj1;
sqInt ptr;
- usqInt savedInHashes;
- usqInt savedOutHashes;
+ sqInt savedInHashes;
+ sqInt savedOutHashes;
sqInt segAddr;
sqInt segStart;
sqInt slotBytes;
@@ -60260,13 +60290,13 @@
/* Answer a new String copied from a null-terminated C string,
or nil if out of memory. */
-usqInt
+sqInt
stringForCString(const char *aCString)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt formatField;
sqInt len;
usqInt newObj;
- usqInt newString;
+ sqInt newString;
usqInt numBytes;
sqInt numSlots;
@@ -61182,7 +61212,7 @@
sqInt largeChild;
sqInt newEndOfMemory;
sqInt next;
- usqInt node;
+ sqInt node;
SpurSegmentInfo *seg;
sqInt smallChild;
sqInt treeNode;
@@ -61493,7 +61523,7 @@
usqLong firstSavedBridgeWord;
sqInt nWritten;
usqInt pier1;
- sqInt pier2;
+ usqInt pier2;
usqLong secondSavedBridgeWord;
pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);
@@ -61998,7 +62028,7 @@
static sqInt
checkForAndFollowForwardedPrimitiveState(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- signed char accessorDepth;
+ sqInt accessorDepth;
sqInt firstBytecode;
sqInt found;
sqInt header;
Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h 2015-03-18 00:12:19 UTC (rev 3280)
+++ branches/Cog/nsspursrc/vm/cointerp.h 2015-03-18 01:13:54 UTC (rev 3281)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
*/
@@ -115,7 +115,7 @@
usqInt sizeOfAlienData(sqInt oop);
void * startOfAlienData(sqInt oop);
sqInt ceClassAtIndex(sqInt classIndex);
-void ceSheduleScavenge(void);
+void ceScheduleScavenge(void);
void ensureNoForwardedLiteralsIn(sqInt aMethodObj);
usqInt freeStartAddress(void);
usqInt getScavengeThreshold(void);
@@ -252,7 +252,7 @@
sqInt splObj(sqInt index);
usqInt storeCheckBoundary(void);
sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-usqInt stringForCString(const char *aCString);
+sqInt stringForCString(const char *aCString);
void tenuringIncrementalGC(void);
sqInt topRemappableOop(void);
sqInt validFreeTree(void);
Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2015-03-18 00:12:19 UTC (rev 3280)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2015-03-18 01:13:54 UTC (rev 3281)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
from
- CoInterpreter VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CoInterpreter VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -807,7 +807,7 @@
static sqInt addressIsInPage(StackPage * self_in_addressIsInPage, char *address) NoDbgRegParms;
static sqInt isFree(StackPage * self_in_isFree) NoDbgRegParms;
sqInt ceClassAtIndex(sqInt classIndex);
-void ceSheduleScavenge(void);
+void ceScheduleScavenge(void);
static void clearLeakMapAndMapAccessibleObjects(void);
void ensureNoForwardedLiteralsIn(sqInt aMethodObj);
usqInt freeStartAddress(void);
@@ -824,7 +824,6 @@
static sqInt addressAfter(sqInt objOop) NoDbgRegParms;
static sqInt allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex) NoDbgRegParms;
static sqInt allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex) NoDbgRegParms;
-static usqInt allocateSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex) NoDbgRegParms;
sqInt byteSwapped(sqInt w);
static usqInt bytesInObject(sqInt objOop) NoDbgRegParms;
static sqInt changeClassOfto(sqInt rcvr, sqInt argClass) NoDbgRegParms;
@@ -1174,7 +1173,7 @@
static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms;
sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-usqInt stringForCString(const char *aCString);
+sqInt stringForCString(const char *aCString);
static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
void tenuringIncrementalGC(void);
@@ -2369,7 +2368,7 @@
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1088";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1095";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -6907,7 +6906,7 @@
usqInt newObj;
usqInt numBytes;
sqInt popValues;
- sqInt size;
+ usqInt size;
VM_LABEL(pushNewArrayBytecode);
size = byteAtPointer(++localIP);
@@ -9853,6 +9852,7 @@
CASE(206)
/* bytecodePrimPointX */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointX);
@@ -9860,8 +9860,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -9888,6 +9894,7 @@
CASE(207)
/* bytecodePrimPointY */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointY);
@@ -9895,8 +9902,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -12362,6 +12375,7 @@
CASE(366) /*110*/
/* bytecodePrimPointX */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointX1);
@@ -12369,8 +12383,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -12397,6 +12417,7 @@
CASE(367) /*111*/
/* bytecodePrimPointY */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointY1);
@@ -12404,8 +12425,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -12839,7 +12866,7 @@
usqInt newObj;
usqInt numBytes;
sqInt popValues;
- sqInt size;
+ usqInt size;
VM_LABEL(pushNewArrayBytecode1);
size = byteAtPointer(++localIP);
@@ -14190,7 +14217,7 @@
CogMethod *cogMethod;
sqInt methodField;
sqInt methodField1;
- usqInt theIP;
+ sqInt theIP;
assertl(GIV(stackPage) == (mostRecentlyUsedPage()), ln);
assertl(addressIsInPage(GIV(stackPage), lifp), ln);
@@ -22076,7 +22103,7 @@
int index;
sqInt methodField;
usqInt numArgs;
- usqInt numTemps;
+ sqInt numTemps;
char *rcvrAddress;
sqInt rcvrOrClosure;
sqInt theMethod;
@@ -22109,7 +22136,7 @@
numArgs = (cogMethod->cmNumArgs);
/* begin temporaryCountOfMethodHeader: */
header = (homeMethod->methodHeader);
- numTemps = ((sqInt) ((((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F));
+ numTemps = (((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F;
}
else {
theMethod = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
@@ -22129,7 +22156,7 @@
assert((((((CogMethod *) header2))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
header1 = ((((CogMethod *) header2))->methodHeader);
}
- numTemps = ((sqInt) ((((usqInt) header1) >> MethodHeaderTempCountShift) & 0x3F));
+ numTemps = (((usqInt) header1) >> MethodHeaderTempCountShift) & 0x3F;
}
if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
@@ -22329,7 +22356,7 @@
/* begin printChar: */
putchar(' ');
if (((((usqInt) (longAt(s))) >> 24) & 0x1F) >= 16) {
- printf("%x %.*s\n", s, numBytesOf(s), (char *)firstIndexableField(s));
+ printf("%lx %.*s\n", s, numBytesOf(s), (char *)firstIndexableField(s));
}
else {
shortPrintOop(s);
@@ -29565,6 +29592,10 @@
primitiveClipboardText(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt fmt;
+ sqInt formatField;
+ usqInt newObj;
+ usqInt numBytes;
+ sqInt numSlots;
sqInt s;
char *sp;
sqInt sz;
@@ -29595,7 +29626,45 @@
/* begin allocateBytes:classIndex: */
assert(addressCouldBeClassObj(classAtIndex(ClassByteStringCompactIndex)));
assert((instSpecOfClass(classAtIndex(ClassByteStringCompactIndex))) == (firstByteFormat()));
- s = ((usqInt) (allocateSlotsformatclassIndex(((sz + BytesPerOop) - 1) / BytesPerOop, 16 + ((8 - sz) & (BytesPerWord - 1)), ClassByteStringCompactIndex)));
+ /* begin allocateSlots:format:classIndex: */
+ numSlots = ((sz + BytesPerOop) - 1) / BytesPerOop;
+ formatField = 16 + ((8 - sz) & (BytesPerWord - 1));
+ if (numSlots >= 0xFF) {
+ newObj = GIV(freeStart) + BaseHeaderSize;
+ numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop);
+ }
+ else {
+ newObj = GIV(freeStart);
+ numBytes = BaseHeaderSize + ((numSlots <= 1
+ ? 8
+ : (numSlots + (numSlots & 1)) * BytesPerOop));
+ }
+ if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
+ if (!GIV(needGCFlag)) {
+ /* begin scheduleScavenge */
+ GIV(needGCFlag) = 1;
+ forceInterruptCheck();
+ }
+ s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+ goto l1;
+ }
+ if (numSlots >= 0xFF) {
+
+ /* for header parsing we put a saturated slot count in the prepended overflow size word */
+
+ flag("endianness");
+ longAtput(GIV(freeStart), numSlots);
+ longAtput(GIV(freeStart) + 4, 0xFF << 24);
+ long64Atput(newObj, (((((usqLong) 0xFF)) << 56) + (formatField << 24)) + ClassByteStringCompactIndex);
+ }
+ else {
+ long64Atput(newObj, (((((usqLong) numSlots)) << 56) + (formatField << 24)) + ClassByteStringCompactIndex);
+ }
+ assert((numBytes % (allocationUnit())) == 0);
+ assert((newObj % (allocationUnit())) == 0);
+ GIV(freeStart) += numBytes;
+ s = newObj;
+ l1: /* end allocateSlots:format:classIndex: */;
if (!(s)) {
/* begin primitiveFail */
if (!GIV(primFailCode)) {
@@ -33343,6 +33412,7 @@
static void
primitiveImageName(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt ok;
sqInt okToRename;
sqInt s;
void *sCRIfn;
@@ -33367,8 +33437,14 @@
}
s = longAt(GIV(stackPointer));
/* begin assertClassOf:is: */
+ ok = (s & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(s));
+ ok = ((longAt(s)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteString << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(s)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteString << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -34793,7 +34869,7 @@
sqInt err;
sqInt hash;
sqInt instSpec;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
sqInt numSlots;
@@ -34908,7 +34984,7 @@
sqInt i;
sqInt instSpec;
sqInt literalCount;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
sqInt numSlots;
@@ -39219,6 +39295,7 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
long bufferSize;
sqInt numSamples;
+ sqInt ok;
sqInt oop;
sqInt running;
sqInt sampleBuffer;
@@ -39259,8 +39336,14 @@
sampleBuffer = oop;
l1: /* end stackObjectValue: */;
/* begin assertClassOf:is: */
+ ok = (sampleBuffer & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(sampleBuffer));
+ ok = ((longAt(sampleBuffer)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBitmap << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(sampleBuffer)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBitmap << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -39716,7 +39799,7 @@
}
void
-ceSheduleScavenge(void)
+ceScheduleScavenge(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
assert(GIV(freeStart) >= GIV(scavengeThreshold));
/* begin scheduleScavenge */
@@ -40317,59 +40400,6 @@
}
-/* Allocate an object with numSlots space. If there is room beneath
- scavengeThreshold allocate in newSpace, otherwise alocate in oldSpace. If
- there is not room in newSpace
- and a scavenge is not already scheduled, schedule a scavenge. */
-/* Object headers are 8 bytes in length if the slot size fits in the num
- slots field (max implies overflow),
- 16 bytes otherwise (num slots in preceeding word).
- Objects always have at least one slot, for the forwarding pointer,
- and are multiples of 8 bytes in length. */
-
-static usqInt
-allocateSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex)
-{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- usqInt newObj;
- usqInt numBytes;
-
- if (numSlots >= 0xFF) {
- newObj = GIV(freeStart) + BaseHeaderSize;
- numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop);
- }
- else {
- newObj = GIV(freeStart);
- numBytes = BaseHeaderSize + ((numSlots <= 1
- ? 8
- : (numSlots + (numSlots & 1)) * BytesPerOop));
- }
- if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
- if (!GIV(needGCFlag)) {
- /* begin scheduleScavenge */
- GIV(needGCFlag) = 1;
- forceInterruptCheck();
- }
- return allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, classIndex);
- }
- if (numSlots >= 0xFF) {
-
- /* for header parsing we put a saturated slot count in the prepended overflow size word */
-
- flag("endianness");
- longAtput(GIV(freeStart), numSlots);
- longAtput(GIV(freeStart) + 4, 0xFF << 24);
- long64Atput(newObj, (((((usqLong) 0xFF)) << 56) + (formatField << 24)) + classIndex);
- }
- else {
- long64Atput(newObj, (((((usqLong) numSlots)) << 56) + (formatField << 24)) + classIndex);
- }
- assert((numBytes % (allocationUnit())) == 0);
- assert((newObj % (allocationUnit())) == 0);
- GIV(freeStart) += numBytes;
- return newObj;
-}
-
-
/* Answer the given integer with its bytes in the reverse order. */
sqInt
@@ -40746,7 +40776,7 @@
sqInt fillValue;
sqInt hash;
sqInt instSpec;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
usqInt numSlots;
@@ -42615,7 +42645,7 @@
sqInt entry;
sqInt expectedIndex;
sqInt expectedIndex1;
- usqInt freeChunk;
+ sqInt freeChunk;
sqInt i;
sqInt i1;
sqInt index;
@@ -42654,8 +42684,8 @@
sqInt ptr1;
sqInt ptr2;
sqInt slotBytes;
- usqInt smallObj;
- usqInt start;
+ sqInt smallObj;
+ sqInt start;
classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
if (classIndex == 0) {
@@ -45589,7 +45619,7 @@
sqInt fmt;
sqInt hasYoung;
sqInt i;
- usqInt newObj;
+ sqInt newObj;
usqInt newObj1;
usqInt numBytes;
usqInt numSlots;
@@ -56715,13 +56745,13 @@
sqInt obj21;
sqInt pigBytes;
usqInt prevFree;
- sqInt prevFreeChunk;
+ usqInt prevFreeChunk;
usqInt prevPrevFree;
- sqInt prevPrevFreeChunk;
+ usqInt prevPrevFreeChunk;
sqInt slotBytes;
sqInt slotBytes1;
usqInt there;
- sqInt thisFreeChunk;
+ usqInt thisFreeChunk;
sqInt usedChunk;
sqInt valuePointer;
sqInt valuePointer1;
@@ -59801,8 +59831,8 @@
sqInt prevPrevObj;
sqInt prevPrevObj1;
sqInt ptr;
- usqInt savedInHashes;
- usqInt savedOutHashes;
+ sqInt savedInHashes;
+ sqInt savedOutHashes;
sqInt segAddr;
sqInt segStart;
sqInt slotBytes;
@@ -60269,13 +60299,13 @@
/* Answer a new String copied from a null-terminated C string,
or nil if out of memory. */
-usqInt
+sqInt
stringForCString(const char *aCString)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt formatField;
sqInt len;
usqInt newObj;
- usqInt newString;
+ sqInt newString;
usqInt numBytes;
sqInt numSlots;
@@ -61191,7 +61221,7 @@
sqInt largeChild;
sqInt newEndOfMemory;
sqInt next;
- usqInt node;
+ sqInt node;
SpurSegmentInfo *seg;
sqInt smallChild;
sqInt treeNode;
@@ -61502,7 +61532,7 @@
usqLong firstSavedBridgeWord;
sqInt nWritten;
usqInt pier1;
- sqInt pier2;
+ usqInt pier2;
usqLong secondSavedBridgeWord;
pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);
@@ -62007,7 +62037,7 @@
static sqInt
checkForAndFollowForwardedPrimitiveState(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- signed char accessorDepth;
+ sqInt accessorDepth;
sqInt firstBytecode;
sqInt found;
sqInt header;
Modified: branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2015-03-18 00:12:19 UTC (rev 3280)
+++ branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2015-03-18 01:13:54 UTC (rev 3281)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
from
- StackInterpreter VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ StackInterpreter VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
*/
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -2114,7 +2114,7 @@
/* 575 */ (void (*)(void))0,
0 };
char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1088";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1095";
volatile int sendTrace;
sqInt suppressHeartbeatFlag;
@@ -9258,6 +9258,7 @@
CASE(206)
/* bytecodePrimPointX */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointX);
@@ -9265,8 +9266,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -9293,6 +9300,7 @@
CASE(207)
/* bytecodePrimPointY */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointY);
@@ -9300,8 +9308,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -11745,6 +11759,7 @@
CASE(366) /*110*/
/* bytecodePrimPointX */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointX1);
@@ -11752,8 +11767,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -11780,6 +11801,7 @@
CASE(367) /*111*/
/* bytecodePrimPointY */
{
+ sqInt ok;
sqInt rcvr;
VM_LABEL(bytecodePrimPointY1);
@@ -11787,8 +11809,14 @@
GIV(primFailCode) = 0;
rcvr = longAtPointer(localSP);
/* begin assertClassOf:is: */
+ ok = (rcvr & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(rcvr));
+ ok = ((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(rcvr)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassPoint << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -18950,6 +18978,7 @@
static void
primitiveImageName(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt ok;
sqInt okToRename;
sqInt s;
void *sCRIfn;
@@ -18974,8 +19003,14 @@
}
s = longAt(GIV(stackPointer));
/* begin assertClassOf:is: */
+ ok = (s & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(s));
+ ok = ((longAt(s)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteString << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(s)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteString << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
@@ -25542,6 +25577,7 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
long bufferSize;
sqInt numSamples;
+ sqInt ok;
sqInt oop;
sqInt running;
sqInt sampleBuffer;
@@ -25582,8 +25618,14 @@
sampleBuffer = oop;
l1: /* end stackObjectValue: */;
/* begin assertClassOf:is: */
+ ok = (sampleBuffer & 3) == 0;
+ if (ok) {
+ /* begin isClassOfNonImm:equalTo: */
+ assert(isNonImmediate(sampleBuffer));
+ ok = ((longAt(sampleBuffer)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBitmap << (shiftForWord())))) + 4)) & 0x3FFFFF);
+ }
/* begin success: */
- if (!(((longAt(sampleBuffer)) & 0x3FFFFF) == ((long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBitmap << (shiftForWord())))) + 4)) & 0x3FFFFF))) {
+ if (!ok) {
/* Don't overwrite an error code that has already been set. */
Modified: branches/Cog/nsspurstacksrc/vm/interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/interp.c 2015-03-18 00:12:19 UTC (rev 3280)
+++ branches/Cog/nsspurstacksrc/vm/interp.c 2015-03-18 01:13:54 UTC (rev 3281)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
from
- StackInterpreter VMMaker.oscog-eem.1088 uuid: 8298a649-68d4-4bac-ace3-46649a076245
+ StackInterpreter VMMaker.oscog-eem.1095 uuid: 87e54293-385c-427c-8c96-3d8b934aa808
*/
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list