Revision: 3408 Author: eliot Date: 2015-07-18 14:59:56 -0700 (Sat, 18 Jul 2015) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.1427
Fix at least one set of 64-bit issues caused by Slang. In particular the integerObjectOf: code resulted in (objectMemory integerObjectOf: MillisecondClockMask) evaluating to the -1 object, instead of the 16r1FFFFFFF object, which was the cause of the initially nresponsive 64-bit image on the real VM.
Don't use cppIf: NewspeakVM(et al) where possible, to avoid leaving #if NewspeakVM everywhere. Instead rely on generation-time dead code removal. Both Newspeak and Squeak VMs benefit from improved readability.
Fix some primitiveFail[For:] calls in potential mirror primitives that did not return after falure, and could hence continue to do damage after detecting a failure condition.
Modified Paths: -------------- branches/Cog/nsspursrc/vm/cogit.h branches/Cog/nsspursrc/vm/cogitARMv5.c branches/Cog/nsspursrc/vm/cogitIA32.c branches/Cog/nsspursrc/vm/cointerp.c branches/Cog/nsspursrc/vm/cointerp.h branches/Cog/nsspursrc/vm/gcc3x-cointerp.c branches/Cog/nsspurstack64src/vm/gcc3x-interp.c branches/Cog/nsspurstack64src/vm/interp.c branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c branches/Cog/nsspurstacksrc/vm/interp.c branches/Cog/spursistasrc/vm/cogit.h branches/Cog/spursistasrc/vm/cogitARMv5.c branches/Cog/spursistasrc/vm/cogitIA32.c branches/Cog/spursistasrc/vm/cointerp.c branches/Cog/spursistasrc/vm/cointerp.h branches/Cog/spursistasrc/vm/gcc3x-cointerp.c branches/Cog/spursrc/vm/cogit.h branches/Cog/spursrc/vm/cogitARMv5.c branches/Cog/spursrc/vm/cogitIA32.c branches/Cog/spursrc/vm/cointerp.c branches/Cog/spursrc/vm/cointerp.h branches/Cog/spursrc/vm/gcc3x-cointerp.c branches/Cog/spurstack64src/vm/gcc3x-interp.c branches/Cog/spurstack64src/vm/interp.c branches/Cog/spurstacksrc/vm/gcc3x-interp.c branches/Cog/spurstacksrc/vm/interp.c branches/Cog/src/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c branches/Cog/src/vm/cogit.h branches/Cog/src/vm/cogitARMv5.c branches/Cog/src/vm/cogitIA32.c 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.h =================================================================== --- branches/Cog/nsspursrc/vm/cogit.h 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspursrc/vm/cogit.h 2015-07-18 21:59:56 UTC (rev 3408) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1423 uuid: cf39cfd3-52f5-4f6b-bba6-892ee83000fe + CCodeGenerator VMMaker.oscog-eem.1427 uuid: c5cb18c5-f69e-4e41-8f87-943a495659b4 */
Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c =================================================================== --- branches/Cog/nsspursrc/vm/cogitARMv5.c 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspursrc/vm/cogitARMv5.c 2015-07-18 21:59:56 UTC (rev 3408) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1423 uuid: cf39cfd3-52f5-4f6b-bba6-892ee83000fe + CCodeGenerator VMMaker.oscog-eem.1427 uuid: c5cb18c5-f69e-4e41-8f87-943a495659b4 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1423 uuid: cf39cfd3-52f5-4f6b-bba6-892ee83000fe + StackToRegisterMappingCogit VMMaker.oscog-eem.1427 uuid: c5cb18c5-f69e-4e41-8f87-943a495659b4 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1423 uuid: cf39cfd3-52f5-4f6b-bba6-892ee83000fe " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1427 uuid: c5cb18c5-f69e-4e41-8f87-943a495659b4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -9895,7 +9895,7 @@ { sqInt classIndex; sqInt i; - sqInt pc; + usqInt pc;
pc = (((((usqInt)cPIC)) + firstCPICCaseOffset) + cPICCaseSize) - (jumpLongConditionalByteSize(backEnd)); for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { @@ -10871,12 +10871,12 @@ generateMapAtstart(sqInt addressOrNull, sqInt startAddress) { unsigned char annotation; - usqInt delta; + sqInt delta; sqInt i; AbstractInstruction *instruction; sqInt length; - usqInt location; - usqInt mapEntry; + sqInt location; + sqInt mapEntry; sqInt maxDelta; usqInt mcpc;
@@ -24829,16 +24829,7 @@ generateNewspeakSendTrampolines();
-# if BytecodeSetHasDirectedSuperSend for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { - directedSuperSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendabovetonumArgs, numArgs, trampolineNamenumArgs("ceDirectedSuperSend", numArgs), ClassReg, TempReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) - ? numArgs - : SendNumArgsReg))); - } - -# endif /* BytecodeSetHasDirectedSuperSend */ - - for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { superSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSuperSend", numArgs), ClassReg, 1, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) ? numArgs : SendNumArgsReg)));
Modified: branches/Cog/nsspursrc/vm/cogitIA32.c =================================================================== --- branches/Cog/nsspursrc/vm/cogitIA32.c 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspursrc/vm/cogitIA32.c 2015-07-18 21:59:56 UTC (rev 3408) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1423 uuid: cf39cfd3-52f5-4f6b-bba6-892ee83000fe + CCodeGenerator VMMaker.oscog-eem.1427 uuid: c5cb18c5-f69e-4e41-8f87-943a495659b4 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1423 uuid: cf39cfd3-52f5-4f6b-bba6-892ee83000fe + StackToRegisterMappingCogit VMMaker.oscog-eem.1427 uuid: c5cb18c5-f69e-4e41-8f87-943a495659b4 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1423 uuid: cf39cfd3-52f5-4f6b-bba6-892ee83000fe " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1427 uuid: c5cb18c5-f69e-4e41-8f87-943a495659b4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -9993,12 +9993,12 @@ generateMapAtstart(sqInt addressOrNull, sqInt startAddress) { unsigned char annotation; - usqInt delta; + sqInt delta; sqInt i; AbstractInstruction *instruction; sqInt length; - usqInt location; - usqInt mapEntry; + sqInt location; + sqInt mapEntry; sqInt maxDelta; usqInt mcpc;
@@ -24464,16 +24464,7 @@ generateNewspeakSendTrampolines();
-# if BytecodeSetHasDirectedSuperSend for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { - directedSuperSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendabovetonumArgs, numArgs, trampolineNamenumArgs("ceDirectedSuperSend", numArgs), ClassReg, TempReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) - ? numArgs - : SendNumArgsReg))); - } - -# endif /* BytecodeSetHasDirectedSuperSend */ - - for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) { superSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargargarg(ceSendsupertonumArgs, numArgs, trampolineNamenumArgs("ceSuperSend", numArgs), ClassReg, 1, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2) ? numArgs : SendNumArgsReg)));
Modified: branches/Cog/nsspursrc/vm/cointerp.c =================================================================== --- branches/Cog/nsspursrc/vm/cointerp.c 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspursrc/vm/cointerp.c 2015-07-18 21:59:56 UTC (rev 3408) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f from - CoInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CoInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -1207,7 +1207,7 @@ static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms; extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); -extern sqInt stringForCString(const char *aCString); +extern usqInt stringForCString(const char *aCString); static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms; static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms; extern void tenuringIncrementalGC(void); @@ -2410,7 +2410,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.1422"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1426"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -6211,15 +6211,8 @@ } GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + ((GIV(lkupClassTag) & ((1 << 10) - 1)) << (shiftForWord()))); l238: /* end classAtIndex: */; - -# if NewspeakVM lookupOrdinarySend();
-# else /* NewspeakVM */ - lookupMethodInClass(GIV(lkupClass)); - -# endif /* NewspeakVM */ - /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -27463,6 +27456,7 @@ validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, char *fp) { CogMethod *cogMethod; + sqInt header; sqInt methodField; usqInt theInstrPointer;
@@ -27485,7 +27479,7 @@ goto l1; } cogMethod = ((CogMethod *) (methodField & MFMethodMask)); - l1: /* end mframeHomeMethod: */; + l1: /* end mframeHomeMethod: */; return (theInstrPointer >= ((((usqInt)cogMethod)) + (sizeof(CogMethod)))) && (theInstrPointer < ((((usqInt)cogMethod)) + ((cogMethod->blockSize)))); } @@ -30616,7 +30610,8 @@ if (!((GIV(argumentCount) < 1) || ((((longAt(GIV(stackPointer))) & 3) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer))))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
result = allInstancesOf(longAt(GIV(stackPointer))); @@ -31591,6 +31586,9 @@ sqInt hashOrError; char *sp;
+ + /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(argumentCount) > 0) { if (!((((longAt(GIV(stackPointer))) & 3) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { @@ -32437,7 +32435,7 @@ GIV(needGCFlag) = 1; forceInterruptCheck(); } - s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex); + s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex))); goto l1; } if (numSlots >= 0xFF) { @@ -38065,7 +38063,7 @@ sqInt err; sqInt hash; sqInt instSpec; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; sqInt numSlots; @@ -38083,7 +38081,8 @@
if (!((GIV(argumentCount) < 1) || (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
@@ -38190,7 +38189,7 @@ sqInt i; usqInt instSpec; sqInt literalCount; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; sqInt numSlots; @@ -38356,6 +38355,15 @@ sqInt value;
spaceOkay = 0; + + /* For the mirror prims check that the class obj is actually a valid class. */ + + if (!((GIV(argumentCount) < 2) + || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + /* begin positiveMachineIntegerValueOf: */ oop1 = longAt(GIV(stackPointer)); if ((oop1 & 1)) { @@ -38428,41 +38436,32 @@ goto l2; } l2: /* end positiveMachineIntegerValueOf: */; - - /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(primFailCode)) {
- if (!((GIV(argumentCount) < 2) - || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { - GIV(primFailCode) = PrimErrBadArgument; - } - - if (!GIV(primFailCode)) { - /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */
- obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); - if (obj == null) { - /* begin instSpecOfClassFormat: */ - instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1))) >> 16) & 0x1F; - /* begin primitiveFailFor: */ - reasonCode = (((instSpec >= 2) - && ((instSpec <= 4) - || (instSpec >= 9))) - && (!(instSpec >= 24)) - ? PrimErrNoMemory - : PrimErrBadReceiver); - GIV(primFailCode) = reasonCode; - } - else { - /* begin pop:thenPush: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); - GIV(stackPointer) = sp; - } - + (GIV(primFailCode) = PrimErrBadArgument); + return; } + obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + if (obj == null) { + /* begin instSpecOfClassFormat: */ + instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1))) >> 16) & 0x1F; + /* begin primitiveFailFor: */ + reasonCode = (((instSpec >= 2) + && ((instSpec <= 4) + || (instSpec >= 9))) + && (!(instSpec >= 24)) + ? PrimErrNoMemory + : PrimErrBadReceiver); + GIV(primFailCode) = reasonCode; + } else { - GIV(primFailCode) = PrimErrBadArgument; + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); + GIV(stackPointer) = sp; } + }
/* InterpreterPrimitives>>#primitiveNextInstance */ @@ -41062,7 +41061,8 @@ if (!((GIV(argumentCount) < 1) || (((class & 3) == 0) && (objCouldBeClassObj(class))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
instance = initialInstanceOf(class); @@ -44106,7 +44106,7 @@ sqInt fillValue; sqInt hash; usqInt instSpec; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; usqInt numSlots; @@ -46238,7 +46238,7 @@ sqInt entry; sqInt expectedIndex; sqInt expectedIndex1; - sqInt freeChunk; + usqInt freeChunk; sqInt i; sqInt i1; sqInt index; @@ -46277,8 +46277,8 @@ sqInt ptr1; sqInt ptr2; sqInt slotBytes; - sqInt smallObj; - sqInt start; + usqInt smallObj; + usqInt start;
classIndex = (long32At(aClass + 4)) & 0x3FFFFF; if (classIndex == 0) { @@ -49219,7 +49219,7 @@ sqInt fmt; sqInt hasYoung; sqInt i; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; usqInt numSlots; @@ -63906,8 +63906,8 @@ sqInt prevPrevObj; sqInt prevPrevObj1; sqInt ptr; - sqInt savedInHashes; - sqInt savedOutHashes; + usqInt savedInHashes; + usqInt savedOutHashes; sqInt segAddr; sqInt segStart; sqInt slotBytes; @@ -64377,13 +64377,13 @@ or nil if out of memory. */
/* SpurMemoryManager>>#stringForCString: */ -sqInt +usqInt stringForCString(const char *aCString) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt formatField; sqInt len; usqInt newObj; - sqInt newString; + usqInt newString; usqInt numBytes; sqInt numSlots;
@@ -65438,7 +65438,7 @@ static sqInt readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt bridge; + usqInt bridge; usqInt bridgehead; usqInt bridgeSpan; sqInt bytesRead; @@ -65654,7 +65654,7 @@ usqLong firstSavedBridgeWord; sqInt nWritten; usqInt pier1; - sqInt pier2; + usqInt pier2; usqLong secondSavedBridgeWord;
pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize); @@ -72744,26 +72744,27 @@ sqInt literal; sqInt objOop; sqInt objOop1; + sqInt objOop2; sqInt offset;
- return (/* begin followLiteral:ofMethod: */ - (offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1), - /* begin followField:ofObject: */ - (objOop1 = longAt((methodPointer + BaseHeaderSize) + ((offset + LiteralStart) << (shiftForWord())))), - (((objOop1 & 3) == 0) - && (((longAt(objOop1)) & 0x3FFFFF) == 8) - ? (objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop1)) + /* begin followLiteral:ofMethod: */ + offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + /* begin followField:ofObject: */ + objOop2 = longAt((methodPointer + BaseHeaderSize) + ((offset + LiteralStart) << (shiftForWord()))); + if (((objOop2 & 3) == 0) + && (((longAt(objOop2)) & 0x3FFFFF) == 8)) { + objOop2 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop2); + } + literal = objOop2; + return (literal == GIV(nilObj) + ? literal + : (/* begin followField:ofObject: */ + (objOop = longAt((literal + BaseHeaderSize) + (ValueIndex << (shiftForWord())))), + (((objOop & 3) == 0) + && (((longAt(objOop)) & 0x3FFFFF) == 8) + ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) : 0), - (literal = objOop1), - (literal == GIV(nilObj) - ? literal - : (/* begin followField:ofObject: */ - (objOop = longAt((literal + BaseHeaderSize) + (ValueIndex << (shiftForWord())))), - (((objOop & 3) == 0) - && (((longAt(objOop)) & 0x3FFFFF) == 8) - ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) - : 0), - objOop))); + objOop)); }
Modified: branches/Cog/nsspursrc/vm/cointerp.h =================================================================== --- branches/Cog/nsspursrc/vm/cointerp.h 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspursrc/vm/cointerp.h 2015-07-18 21:59:56 UTC (rev 3408) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f */
@@ -258,7 +258,7 @@ extern sqInt splObj(sqInt index); extern usqInt storeCheckBoundary(void); extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); -extern sqInt stringForCString(const char *aCString); +extern usqInt stringForCString(const char *aCString); extern void tenuringIncrementalGC(void); extern sqInt topRemappableOop(void); extern sqInt validFreeTree(void);
Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c =================================================================== --- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2015-07-18 21:59:56 UTC (rev 3408) @@ -2,11 +2,11 @@
/* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f from - CoInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CoInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -1210,7 +1210,7 @@ static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms; extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer); -extern sqInt stringForCString(const char *aCString); +extern usqInt stringForCString(const char *aCString); static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms; static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms; extern void tenuringIncrementalGC(void); @@ -2413,7 +2413,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.1422"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1426"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -6220,15 +6220,8 @@ } GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + ((GIV(lkupClassTag) & ((1 << 10) - 1)) << (shiftForWord()))); l238: /* end classAtIndex: */; - -# if NewspeakVM lookupOrdinarySend();
-# else /* NewspeakVM */ - lookupMethodInClass(GIV(lkupClass)); - -# endif /* NewspeakVM */ - /* begin internalizeIPandSP */ assert(GIV(instructionPointer) != (ceReturnToInterpreterPC())); localIP = pointerForOop(GIV(instructionPointer)); @@ -27472,6 +27465,7 @@ validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, char *fp) { CogMethod *cogMethod; + sqInt header; sqInt methodField; usqInt theInstrPointer;
@@ -27494,7 +27488,7 @@ goto l1; } cogMethod = ((CogMethod *) (methodField & MFMethodMask)); - l1: /* end mframeHomeMethod: */; + l1: /* end mframeHomeMethod: */; return (theInstrPointer >= ((((usqInt)cogMethod)) + (sizeof(CogMethod)))) && (theInstrPointer < ((((usqInt)cogMethod)) + ((cogMethod->blockSize)))); } @@ -30625,7 +30619,8 @@ if (!((GIV(argumentCount) < 1) || ((((longAt(GIV(stackPointer))) & 3) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer))))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
result = allInstancesOf(longAt(GIV(stackPointer))); @@ -31600,6 +31595,9 @@ sqInt hashOrError; char *sp;
+ + /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(argumentCount) > 0) { if (!((((longAt(GIV(stackPointer))) & 3) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { @@ -32446,7 +32444,7 @@ GIV(needGCFlag) = 1; forceInterruptCheck(); } - s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex); + s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex))); goto l1; } if (numSlots >= 0xFF) { @@ -38074,7 +38072,7 @@ sqInt err; sqInt hash; sqInt instSpec; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; sqInt numSlots; @@ -38092,7 +38090,8 @@
if (!((GIV(argumentCount) < 1) || (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
@@ -38199,7 +38198,7 @@ sqInt i; usqInt instSpec; sqInt literalCount; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; sqInt numSlots; @@ -38365,6 +38364,15 @@ sqInt value;
spaceOkay = 0; + + /* For the mirror prims check that the class obj is actually a valid class. */ + + if (!((GIV(argumentCount) < 2) + || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + /* begin positiveMachineIntegerValueOf: */ oop1 = longAt(GIV(stackPointer)); if ((oop1 & 1)) { @@ -38437,41 +38445,32 @@ goto l2; } l2: /* end positiveMachineIntegerValueOf: */; - - /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(primFailCode)) {
- if (!((GIV(argumentCount) < 2) - || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { - GIV(primFailCode) = PrimErrBadArgument; - } - - if (!GIV(primFailCode)) { - /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */
- obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); - if (obj == null) { - /* begin instSpecOfClassFormat: */ - instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1))) >> 16) & 0x1F; - /* begin primitiveFailFor: */ - reasonCode = (((instSpec >= 2) - && ((instSpec <= 4) - || (instSpec >= 9))) - && (!(instSpec >= 24)) - ? PrimErrNoMemory - : PrimErrBadReceiver); - GIV(primFailCode) = reasonCode; - } - else { - /* begin pop:thenPush: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); - GIV(stackPointer) = sp; - } - + (GIV(primFailCode) = PrimErrBadArgument); + return; } + obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + if (obj == null) { + /* begin instSpecOfClassFormat: */ + instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1))) >> 16) & 0x1F; + /* begin primitiveFailFor: */ + reasonCode = (((instSpec >= 2) + && ((instSpec <= 4) + || (instSpec >= 9))) + && (!(instSpec >= 24)) + ? PrimErrNoMemory + : PrimErrBadReceiver); + GIV(primFailCode) = reasonCode; + } else { - GIV(primFailCode) = PrimErrBadArgument; + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); + GIV(stackPointer) = sp; } + }
/* InterpreterPrimitives>>#primitiveNextInstance */ @@ -41071,7 +41070,8 @@ if (!((GIV(argumentCount) < 1) || (((class & 3) == 0) && (objCouldBeClassObj(class))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
instance = initialInstanceOf(class); @@ -44115,7 +44115,7 @@ sqInt fillValue; sqInt hash; usqInt instSpec; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; usqInt numSlots; @@ -46247,7 +46247,7 @@ sqInt entry; sqInt expectedIndex; sqInt expectedIndex1; - sqInt freeChunk; + usqInt freeChunk; sqInt i; sqInt i1; sqInt index; @@ -46286,8 +46286,8 @@ sqInt ptr1; sqInt ptr2; sqInt slotBytes; - sqInt smallObj; - sqInt start; + usqInt smallObj; + usqInt start;
classIndex = (long32At(aClass + 4)) & 0x3FFFFF; if (classIndex == 0) { @@ -49228,7 +49228,7 @@ sqInt fmt; sqInt hasYoung; sqInt i; - sqInt newObj; + usqInt newObj; usqInt newObj1; usqInt numBytes; usqInt numSlots; @@ -63915,8 +63915,8 @@ sqInt prevPrevObj; sqInt prevPrevObj1; sqInt ptr; - sqInt savedInHashes; - sqInt savedOutHashes; + usqInt savedInHashes; + usqInt savedOutHashes; sqInt segAddr; sqInt segStart; sqInt slotBytes; @@ -64386,13 +64386,13 @@ or nil if out of memory. */
/* SpurMemoryManager>>#stringForCString: */ -sqInt +usqInt stringForCString(const char *aCString) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt formatField; sqInt len; usqInt newObj; - sqInt newString; + usqInt newString; usqInt numBytes; sqInt numSlots;
@@ -65447,7 +65447,7 @@ static sqInt readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt bridge; + usqInt bridge; usqInt bridgehead; usqInt bridgeSpan; sqInt bytesRead; @@ -65663,7 +65663,7 @@ usqLong firstSavedBridgeWord; sqInt nWritten; usqInt pier1; - sqInt pier2; + usqInt pier2; usqLong secondSavedBridgeWord;
pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize); @@ -72753,26 +72753,27 @@ sqInt literal; sqInt objOop; sqInt objOop1; + sqInt objOop2; sqInt offset;
- return (/* begin followLiteral:ofMethod: */ - (offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1), - /* begin followField:ofObject: */ - (objOop1 = longAt((methodPointer + BaseHeaderSize) + ((offset + LiteralStart) << (shiftForWord())))), - (((objOop1 & 3) == 0) - && (((longAt(objOop1)) & 0x3FFFFF) == 8) - ? (objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop1)) + /* begin followLiteral:ofMethod: */ + offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + /* begin followField:ofObject: */ + objOop2 = longAt((methodPointer + BaseHeaderSize) + ((offset + LiteralStart) << (shiftForWord()))); + if (((objOop2 & 3) == 0) + && (((longAt(objOop2)) & 0x3FFFFF) == 8)) { + objOop2 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop2); + } + literal = objOop2; + return (literal == GIV(nilObj) + ? literal + : (/* begin followField:ofObject: */ + (objOop = longAt((literal + BaseHeaderSize) + (ValueIndex << (shiftForWord())))), + (((objOop & 3) == 0) + && (((longAt(objOop)) & 0x3FFFFF) == 8) + ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) : 0), - (literal = objOop1), - (literal == GIV(nilObj) - ? literal - : (/* begin followField:ofObject: */ - (objOop = longAt((literal + BaseHeaderSize) + (ValueIndex << (shiftForWord())))), - (((objOop & 3) == 0) - && (((longAt(objOop)) & 0x3FFFFF) == 8) - ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) - : 0), - objOop))); + objOop)); }
Modified: branches/Cog/nsspurstack64src/vm/gcc3x-interp.c =================================================================== --- branches/Cog/nsspurstack64src/vm/gcc3x-interp.c 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspurstack64src/vm/gcc3x-interp.c 2015-07-18 21:59:56 UTC (rev 3408) @@ -2,11 +2,11 @@
/* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f from - StackInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + StackInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -2173,7 +2173,7 @@ /* 575 */ (void (*)(void))0, 0 }; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1422"; +const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1426"; volatile int sendTrace; sqInt suppressHeartbeatFlag;
@@ -5808,15 +5808,8 @@ } GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((long)(GIV(lkupClassTag) & ((1LL << 10) - 1))) << (shiftForWord()))); l190: /* end classAtIndex: */; - -# if NewspeakVM lookupOrdinarySend();
-# else /* NewspeakVM */ - lookupMethodInClass(GIV(lkupClass)); - -# endif /* NewspeakVM */ - /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -15631,7 +15624,8 @@ if (!((GIV(argumentCount) < 1) || ((((longAt(GIV(stackPointer))) & 7) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer))))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
result = allInstancesOf(longAt(GIV(stackPointer))); @@ -16533,6 +16527,9 @@ sqInt hashOrError; char *sp;
+ + /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(argumentCount) > 0) { if (!((((longAt(GIV(stackPointer))) & 7) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { @@ -21196,7 +21193,7 @@ char *sp;
/* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((0 << 3) | 1)); + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((sqInt)0 << 3) | 1)); GIV(stackPointer) = sp; }
@@ -22270,7 +22267,7 @@ char *sp;
/* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((0x3FFFFF << 3) | 1)); + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((sqInt)0x3FFFFF << 3) | 1)); GIV(stackPointer) = sp; }
@@ -22315,7 +22312,7 @@ char *sp;
/* begin pop:thenPush: */ - longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((MillisecondClockMask << 3) | 1)); + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((sqInt)MillisecondClockMask << 3) | 1)); GIV(stackPointer) = sp; }
@@ -22667,7 +22664,8 @@
if (!((GIV(argumentCount) < 1) || (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
@@ -22942,6 +22940,15 @@ sqInt value;
spaceOkay = 0; + + /* For the mirror prims check that the class obj is actually a valid class. */ + + if (!((GIV(argumentCount) < 2) + || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + /* begin positiveMachineIntegerValueOf: */ oop1 = longAt(GIV(stackPointer)); if ((((oop1) & 7) == 1)) { @@ -23014,41 +23021,32 @@ goto l2; } l2: /* end positiveMachineIntegerValueOf: */; - - /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(primFailCode)) {
- if (!((GIV(argumentCount) < 2) - || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { - GIV(primFailCode) = PrimErrBadArgument; - } - - if (!GIV(primFailCode)) { - /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */
- obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); - if (obj == null) { - /* begin instSpecOfClassFormat: */ - instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3))) >> 16) & 0x1F; - /* begin primitiveFailFor: */ - reasonCode = (((instSpec >= 2) - && ((instSpec <= 4) - || (instSpec >= 9))) - && (!(instSpec >= 24)) - ? PrimErrNoMemory - : PrimErrBadReceiver); - GIV(primFailCode) = reasonCode; - } - else { - /* begin pop:thenPush: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); - GIV(stackPointer) = sp; - } - + (GIV(primFailCode) = PrimErrBadArgument); + return; } + obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + if (obj == null) { + /* begin instSpecOfClassFormat: */ + instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3))) >> 16) & 0x1F; + /* begin primitiveFailFor: */ + reasonCode = (((instSpec >= 2) + && ((instSpec <= 4) + || (instSpec >= 9))) + && (!(instSpec >= 24)) + ? PrimErrNoMemory + : PrimErrBadReceiver); + GIV(primFailCode) = reasonCode; + } else { - GIV(primFailCode) = PrimErrBadArgument; + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); + GIV(stackPointer) = sp; } + }
/* InterpreterPrimitives>>#primitiveNextInstance */ @@ -23223,7 +23221,7 @@ instance = accessibleObjectAfter(longAt(GIV(stackPointer))); if (instance == null) { /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((0 << 3) | 1)); + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((sqInt)0 << 3) | 1)); GIV(stackPointer) = sp; } else { @@ -27148,7 +27146,8 @@ if (!((GIV(argumentCount) < 1) || (((class & 7) == 0) && (objCouldBeClassObj(class))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
instance = initialInstanceOf(class); @@ -63584,26 +63583,27 @@ sqInt literal; sqInt objOop; sqInt objOop1; + sqInt objOop2; sqInt offset;
- return (/* begin followLiteral:ofMethod: */ - (offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1), - /* begin followField:ofObject: */ - (objOop1 = longAt((methodPointer + BaseHeaderSize) + (((long)(offset + LiteralStart)) << (shiftForWord())))), - (((objOop1 & 7) == 0) - && (((longAt(objOop1)) & 0x3FFFFF) == 8) - ? (objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop1)) + /* begin followLiteral:ofMethod: */ + offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + /* begin followField:ofObject: */ + objOop2 = longAt((methodPointer + BaseHeaderSize) + (((long)(offset + LiteralStart)) << (shiftForWord()))); + if (((objOop2 & 7) == 0) + && (((longAt(objOop2)) & 0x3FFFFF) == 8)) { + objOop2 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop2); + } + literal = objOop2; + return (literal == GIV(nilObj) + ? literal + : (/* begin followField:ofObject: */ + (objOop = longAt((literal + BaseHeaderSize) + (((long)ValueIndex) << (shiftForWord())))), + (((objOop & 7) == 0) + && (((longAt(objOop)) & 0x3FFFFF) == 8) + ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) : 0), - (literal = objOop1), - (literal == GIV(nilObj) - ? literal - : (/* begin followField:ofObject: */ - (objOop = longAt((literal + BaseHeaderSize) + (((long)ValueIndex) << (shiftForWord())))), - (((objOop & 7) == 0) - && (((longAt(objOop)) & 0x3FFFFF) == 8) - ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) - : 0), - objOop))); + objOop)); }
/* StackInterpreter>>#methodHeaderIndicatesLargeFrame: */ @@ -75910,10 +75910,10 @@ longAtput((result + BaseHeaderSize) + (26LL << (shiftForWord())), ((GIV(statMarkCount) << 3) | 1)); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(result))); - longAtput((result + BaseHeaderSize) + (27LL << (shiftForWord())), ((0 << 3) | 1)); + longAtput((result + BaseHeaderSize) + (27LL << (shiftForWord())), (((sqInt)0 << 3) | 1)); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(result))); - longAtput((result + BaseHeaderSize) + (28LL << (shiftForWord())), ((0 << 3) | 1)); + longAtput((result + BaseHeaderSize) + (28LL << (shiftForWord())), (((sqInt)0 << 3) | 1)); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(result))); longAtput((result + BaseHeaderSize) + (29LL << (shiftForWord())), ((GIV(statCompactPassCount) << 3) | 1)); @@ -76218,10 +76218,10 @@ result = ((GIV(statMarkCount) << 3) | 1); } if (arg == 28) { - result = ((0 << 3) | 1); + result = (((sqInt)0 << 3) | 1); } if (arg == 29) { - result = ((0 << 3) | 1); + result = (((sqInt)0 << 3) | 1); } if (arg == 30) { result = ((GIV(statCompactPassCount) << 3) | 1);
Modified: branches/Cog/nsspurstack64src/vm/interp.c =================================================================== --- branches/Cog/nsspurstack64src/vm/interp.c 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspurstack64src/vm/interp.c 2015-07-18 21:59:56 UTC (rev 3408) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f from - StackInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + StackInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -2170,7 +2170,7 @@ /* 575 */ (void (*)(void))0, 0 }; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1422"; +const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1426"; volatile int sendTrace; sqInt suppressHeartbeatFlag;
@@ -5799,15 +5799,8 @@ } GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((long)(GIV(lkupClassTag) & ((1LL << 10) - 1))) << (shiftForWord()))); l190: /* end classAtIndex: */; - -# if NewspeakVM lookupOrdinarySend();
-# else /* NewspeakVM */ - lookupMethodInClass(GIV(lkupClass)); - -# endif /* NewspeakVM */ - /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -15622,7 +15615,8 @@ if (!((GIV(argumentCount) < 1) || ((((longAt(GIV(stackPointer))) & 7) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer))))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
result = allInstancesOf(longAt(GIV(stackPointer))); @@ -16524,6 +16518,9 @@ sqInt hashOrError; char *sp;
+ + /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(argumentCount) > 0) { if (!((((longAt(GIV(stackPointer))) & 7) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { @@ -21187,7 +21184,7 @@ char *sp;
/* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((0 << 3) | 1)); + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((sqInt)0 << 3) | 1)); GIV(stackPointer) = sp; }
@@ -22261,7 +22258,7 @@ char *sp;
/* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((0x3FFFFF << 3) | 1)); + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((sqInt)0x3FFFFF << 3) | 1)); GIV(stackPointer) = sp; }
@@ -22306,7 +22303,7 @@ char *sp;
/* begin pop:thenPush: */ - longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((MillisecondClockMask << 3) | 1)); + longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((sqInt)MillisecondClockMask << 3) | 1)); GIV(stackPointer) = sp; }
@@ -22658,7 +22655,8 @@
if (!((GIV(argumentCount) < 1) || (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
@@ -22933,6 +22931,15 @@ sqInt value;
spaceOkay = 0; + + /* For the mirror prims check that the class obj is actually a valid class. */ + + if (!((GIV(argumentCount) < 2) + || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { + (GIV(primFailCode) = PrimErrBadArgument); + return; + } + /* begin positiveMachineIntegerValueOf: */ oop1 = longAt(GIV(stackPointer)); if ((((oop1) & 7) == 1)) { @@ -23005,41 +23012,32 @@ goto l2; } l2: /* end positiveMachineIntegerValueOf: */; - - /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(primFailCode)) {
- if (!((GIV(argumentCount) < 2) - || (addressCouldBeClassObj(longAt(GIV(stackPointer) + (1 * BytesPerWord)))))) { - GIV(primFailCode) = PrimErrBadArgument; - } - - if (!GIV(primFailCode)) { - /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */
- obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); - if (obj == null) { - /* begin instSpecOfClassFormat: */ - instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3))) >> 16) & 0x1F; - /* begin primitiveFailFor: */ - reasonCode = (((instSpec >= 2) - && ((instSpec <= 4) - || (instSpec >= 9))) - && (!(instSpec >= 24)) - ? PrimErrNoMemory - : PrimErrBadReceiver); - GIV(primFailCode) = reasonCode; - } - else { - /* begin pop:thenPush: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); - GIV(stackPointer) = sp; - } - + (GIV(primFailCode) = PrimErrBadArgument); + return; } + obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + if (obj == null) { + /* begin instSpecOfClassFormat: */ + instSpec = (((usqInt) (((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3))) >> 16) & 0x1F; + /* begin primitiveFailFor: */ + reasonCode = (((instSpec >= 2) + && ((instSpec <= 4) + || (instSpec >= 9))) + && (!(instSpec >= 24)) + ? PrimErrNoMemory + : PrimErrBadReceiver); + GIV(primFailCode) = reasonCode; + } else { - GIV(primFailCode) = PrimErrBadArgument; + /* begin pop:thenPush: */ + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj); + GIV(stackPointer) = sp; } + }
/* InterpreterPrimitives>>#primitiveNextInstance */ @@ -23214,7 +23212,7 @@ instance = accessibleObjectAfter(longAt(GIV(stackPointer))); if (instance == null) { /* begin pop:thenPushInteger: */ - longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((0 << 3) | 1)); + longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((sqInt)0 << 3) | 1)); GIV(stackPointer) = sp; } else { @@ -27139,7 +27137,8 @@ if (!((GIV(argumentCount) < 1) || (((class & 7) == 0) && (objCouldBeClassObj(class))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
instance = initialInstanceOf(class); @@ -63575,26 +63574,27 @@ sqInt literal; sqInt objOop; sqInt objOop1; + sqInt objOop2; sqInt offset;
- return (/* begin followLiteral:ofMethod: */ - (offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1), - /* begin followField:ofObject: */ - (objOop1 = longAt((methodPointer + BaseHeaderSize) + (((long)(offset + LiteralStart)) << (shiftForWord())))), - (((objOop1 & 7) == 0) - && (((longAt(objOop1)) & 0x3FFFFF) == 8) - ? (objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop1)) + /* begin followLiteral:ofMethod: */ + offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1; + /* begin followField:ofObject: */ + objOop2 = longAt((methodPointer + BaseHeaderSize) + (((long)(offset + LiteralStart)) << (shiftForWord()))); + if (((objOop2 & 7) == 0) + && (((longAt(objOop2)) & 0x3FFFFF) == 8)) { + objOop2 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop2); + } + literal = objOop2; + return (literal == GIV(nilObj) + ? literal + : (/* begin followField:ofObject: */ + (objOop = longAt((literal + BaseHeaderSize) + (((long)ValueIndex) << (shiftForWord())))), + (((objOop & 7) == 0) + && (((longAt(objOop)) & 0x3FFFFF) == 8) + ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) : 0), - (literal = objOop1), - (literal == GIV(nilObj) - ? literal - : (/* begin followField:ofObject: */ - (objOop = longAt((literal + BaseHeaderSize) + (((long)ValueIndex) << (shiftForWord())))), - (((objOop & 7) == 0) - && (((longAt(objOop)) & 0x3FFFFF) == 8) - ? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop)) - : 0), - objOop))); + objOop)); }
/* StackInterpreter>>#methodHeaderIndicatesLargeFrame: */ @@ -75901,10 +75901,10 @@ longAtput((result + BaseHeaderSize) + (26LL << (shiftForWord())), ((GIV(statMarkCount) << 3) | 1)); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(result))); - longAtput((result + BaseHeaderSize) + (27LL << (shiftForWord())), ((0 << 3) | 1)); + longAtput((result + BaseHeaderSize) + (27LL << (shiftForWord())), (((sqInt)0 << 3) | 1)); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(result))); - longAtput((result + BaseHeaderSize) + (28LL << (shiftForWord())), ((0 << 3) | 1)); + longAtput((result + BaseHeaderSize) + (28LL << (shiftForWord())), (((sqInt)0 << 3) | 1)); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(result))); longAtput((result + BaseHeaderSize) + (29LL << (shiftForWord())), ((GIV(statCompactPassCount) << 3) | 1)); @@ -76209,10 +76209,10 @@ result = ((GIV(statMarkCount) << 3) | 1); } if (arg == 28) { - result = ((0 << 3) | 1); + result = (((sqInt)0 << 3) | 1); } if (arg == 29) { - result = ((0 << 3) | 1); + result = (((sqInt)0 << 3) | 1); } if (arg == 30) { result = ((GIV(statCompactPassCount) << 3) | 1);
Modified: branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c =================================================================== --- branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2015-07-16 23:33:11 UTC (rev 3407) +++ branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2015-07-18 21:59:56 UTC (rev 3408) @@ -2,11 +2,11 @@
/* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f from - StackInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 + StackInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1422 uuid: 72d0eb67-7dbb-463f-8481-c6677291e4f6 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1426 uuid: 94ab92ba-c5c4-4953-8566-a4cd9c38df1f " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -2144,7 +2144,7 @@ /* 575 */ (void (*)(void))0, 0 }; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1422"; +const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1426"; volatile int sendTrace; sqInt suppressHeartbeatFlag;
@@ -5781,15 +5781,8 @@ } GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + ((GIV(lkupClassTag) & ((1 << 10) - 1)) << (shiftForWord()))); l236: /* end classAtIndex: */; - -# if NewspeakVM lookupOrdinarySend();
-# else /* NewspeakVM */ - lookupMethodInClass(GIV(lkupClass)); - -# endif /* NewspeakVM */ - /* begin internalizeIPandSP */ localIP = pointerForOop(GIV(instructionPointer)); localSP = pointerForOop(GIV(stackPointer)); @@ -14986,7 +14979,8 @@ if (!((GIV(argumentCount) < 1) || ((((longAt(GIV(stackPointer))) & 3) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer))))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
result = allInstancesOf(longAt(GIV(stackPointer))); @@ -15961,6 +15955,9 @@ sqInt hashOrError; char *sp;
+ + /* For the mirror prims check that the class obj is actually a valid class. */ + if (GIV(argumentCount) > 0) { if (!((((longAt(GIV(stackPointer))) & 3) == 0) && (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { @@ -22256,7 +22253,8 @@
if (!((GIV(argumentCount) < 1) || (objCouldBeClassObj(longAt(GIV(stackPointer)))))) { - GIV(primFailCode) = PrimErrBadArgument; + (GIV(primFailCode) = PrimErrBadArgument); + return; }
@@ -22529,6 +22527,15 @@ sqInt value;
spaceOkay = 0; +
@@ Diff output truncated at 50000 characters. @@
vm-dev@lists.squeakfoundation.org