diff --git a/src/spur32.cog/cogit.h b/src/spur32.cog/cogit.h index 97f1147b79..b3975cccfc 100644 --- a/src/spur32.cog/cogit.h +++ b/src/spur32.cog/cogit.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGenerator VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ diff --git a/src/spur32.cog/cointerp.c b/src/spur32.cog/cointerp.c index 9630efe3aa..1fe8dfe3cd 100644 --- a/src/spur32.cog/cointerp.c +++ b/src/spur32.cog/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -900,6 +900,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2658,7 +2659,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -20352,7 +20353,7 @@ printFrameWithSP(char *theFP, char *theSP) usqInt index; sqInt methodField; usqInt numArgs; - usqInt numTemps; + sqInt numTemps; char *rcvrAddress; sqInt rcvrOrClosure; CogBlockMethod * self_in_cmHomeMethod; @@ -38579,8 +38580,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -38599,10 +38610,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -38610,22 +38621,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -38637,15 +38648,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -38653,7 +38664,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -40427,6 +40551,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. @@ -54129,8 +54378,8 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; sqInt classIndex1; - sqInt clone1; - sqInt clone2; + usqInt clone1; + usqInt clone2; sqInt format; sqInt format1; sqInt hash; @@ -61041,7 +61290,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - sqInt node; + usqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -64836,8 +65085,8 @@ static sqInt getErrorObjectFromPrimFailCode(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - sqInt clone; - sqInt errObj; + usqInt clone; + usqInt errObj; sqInt fieldIndex; sqInt i; usqInt newObj; diff --git a/src/spur32.cog/cointerp.h b/src/spur32.cog/cointerp.h index 3a461d7dee..be9e10db02 100644 --- a/src/spur32.cog/cointerp.h +++ b/src/spur32.cog/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ @@ -149,6 +149,7 @@ extern double floatValueOf(sqInt oop); extern sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt isIntegerValue(sqInt intValue); extern sqInt isMarked(sqInt objOop); extern usqInt smallObjectBytesForSlots(sqInt numSlots); diff --git a/src/spur32.cog/cointerpmt.c b/src/spur32.cog/cointerpmt.c index 70674faa48..0b07f44b71 100644 --- a/src/spur32.cog/cointerpmt.c +++ b/src/spur32.cog/cointerpmt.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -981,6 +981,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2751,7 +2752,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -41281,8 +41282,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -41301,10 +41312,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -41312,22 +41323,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -41339,15 +41350,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -41355,7 +41366,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -43142,6 +43266,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. diff --git a/src/spur32.cog/cointerpmt.h b/src/spur32.cog/cointerpmt.h index d6bede57f8..c735ce0809 100644 --- a/src/spur32.cog/cointerpmt.h +++ b/src/spur32.cog/cointerpmt.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ @@ -153,6 +153,7 @@ extern double floatValueOf(sqInt oop); extern sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt isIntegerValue(sqInt intValue); extern sqInt isMarked(sqInt objOop); extern usqInt smallObjectBytesForSlots(sqInt numSlots); diff --git a/src/spur32.cog/gcc3x-cointerp.c b/src/spur32.cog/gcc3x-cointerp.c index 99b6ebbb9c..939481e775 100644 --- a/src/spur32.cog/gcc3x-cointerp.c +++ b/src/spur32.cog/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -903,6 +903,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2661,7 +2662,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -20361,7 +20362,7 @@ printFrameWithSP(char *theFP, char *theSP) usqInt index; sqInt methodField; usqInt numArgs; - usqInt numTemps; + sqInt numTemps; char *rcvrAddress; sqInt rcvrOrClosure; CogBlockMethod * self_in_cmHomeMethod; @@ -38588,8 +38589,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -38608,10 +38619,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -38619,22 +38630,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -38646,15 +38657,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -38662,7 +38673,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -40436,6 +40560,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. @@ -54138,8 +54387,8 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; sqInt classIndex1; - sqInt clone1; - sqInt clone2; + usqInt clone1; + usqInt clone2; sqInt format; sqInt format1; sqInt hash; @@ -61050,7 +61299,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - sqInt node; + usqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -64845,8 +65094,8 @@ static sqInt getErrorObjectFromPrimFailCode(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - sqInt clone; - sqInt errObj; + usqInt clone; + usqInt errObj; sqInt fieldIndex; sqInt i; usqInt newObj; diff --git a/src/spur32.cog/gcc3x-cointerpmt.c b/src/spur32.cog/gcc3x-cointerpmt.c index ad9c9c68da..23e17bc959 100644 --- a/src/spur32.cog/gcc3x-cointerpmt.c +++ b/src/spur32.cog/gcc3x-cointerpmt.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -984,6 +984,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2754,7 +2755,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -41290,8 +41291,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -41310,10 +41321,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -41321,22 +41332,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -41348,15 +41359,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -41364,7 +41375,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -43151,6 +43275,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. diff --git a/src/spur32.sista/cogit.h b/src/spur32.sista/cogit.h index 79db4b3364..38db4090a2 100644 --- a/src/spur32.sista/cogit.h +++ b/src/spur32.sista/cogit.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGenerator VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ diff --git a/src/spur32.sista/cointerp.c b/src/spur32.sista/cointerp.c index 7c54a34c36..404b739888 100644 --- a/src/spur32.sista/cointerp.c +++ b/src/spur32.sista/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -908,6 +908,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2673,7 +2674,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -22028,7 +22029,7 @@ mnuMethodOrNilFor(sqInt rcvr) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt currentClass; sqInt dictionary; - sqInt index; + usqInt index; usqInt length; sqInt mask; sqInt methodArray; @@ -22077,7 +22078,7 @@ mnuMethodOrNilFor(sqInt rcvr) wrapAround = 0; while (1) { /* begin fetchPointer:ofObject: */ - nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord()))); if (nextSelector == GIV(nilObj)) { mnuMethod = null; goto l11; @@ -22095,7 +22096,7 @@ mnuMethodOrNilFor(sqInt rcvr) } methodArray = objOop; /* begin followField:ofObject: */ - objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord()))); if (((!(objOop1 & (tagMask())))) && ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) { objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); @@ -41550,8 +41551,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -41570,10 +41581,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -41581,22 +41592,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -41608,15 +41619,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -41624,7 +41635,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -43415,6 +43539,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. @@ -64089,7 +64338,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -70084,7 +70333,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt currentClass; sqInt dictionary; - sqInt index; + usqInt index; usqInt length; sqInt mask; sqInt meth; @@ -70128,7 +70377,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) wrapAround = 0; while (1) { /* begin fetchPointer:ofObject: */ - nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord()))); if (nextSelector == GIV(nilObj)) { meth = null; goto l8; @@ -70146,7 +70395,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) } methodArray = objOop2; /* begin followField:ofObject: */ - objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord()))); if (((!(objOop1 & (tagMask())))) && ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) { objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); diff --git a/src/spur32.sista/cointerp.h b/src/spur32.sista/cointerp.h index 4e3a2483bf..a9d0a18d0b 100644 --- a/src/spur32.sista/cointerp.h +++ b/src/spur32.sista/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ @@ -152,6 +152,7 @@ extern double floatValueOf(sqInt oop); extern sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt isIntegerValue(sqInt intValue); extern sqInt isMarked(sqInt objOop); extern usqInt smallObjectBytesForSlots(sqInt numSlots); diff --git a/src/spur32.sista/gcc3x-cointerp.c b/src/spur32.sista/gcc3x-cointerp.c index 276a472a89..d57b5bb6c6 100644 --- a/src/spur32.sista/gcc3x-cointerp.c +++ b/src/spur32.sista/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -911,6 +911,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2676,7 +2677,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -22037,7 +22038,7 @@ mnuMethodOrNilFor(sqInt rcvr) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt currentClass; sqInt dictionary; - sqInt index; + usqInt index; usqInt length; sqInt mask; sqInt methodArray; @@ -22086,7 +22087,7 @@ mnuMethodOrNilFor(sqInt rcvr) wrapAround = 0; while (1) { /* begin fetchPointer:ofObject: */ - nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord()))); if (nextSelector == GIV(nilObj)) { mnuMethod = null; goto l11; @@ -22104,7 +22105,7 @@ mnuMethodOrNilFor(sqInt rcvr) } methodArray = objOop; /* begin followField:ofObject: */ - objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord()))); if (((!(objOop1 & (tagMask())))) && ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) { objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); @@ -41559,8 +41560,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -41579,10 +41590,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -41590,22 +41601,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -41617,15 +41628,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -41633,7 +41644,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -43424,6 +43548,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. @@ -64098,7 +64347,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -70093,7 +70342,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt currentClass; sqInt dictionary; - sqInt index; + usqInt index; usqInt length; sqInt mask; sqInt meth; @@ -70137,7 +70386,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) wrapAround = 0; while (1) { /* begin fetchPointer:ofObject: */ - nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))); + nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord()))); if (nextSelector == GIV(nilObj)) { meth = null; goto l8; @@ -70155,7 +70404,7 @@ lookupSelectorinClass(sqInt selector, sqInt class) } methodArray = objOop2; /* begin followField:ofObject: */ - objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord()))))); + objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord()))); if (((!(objOop1 & (tagMask())))) && ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) { objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1); diff --git a/src/spur32.stack/gcc3x-interp.c b/src/spur32.stack/gcc3x-interp.c index 7382f2fdea..9389c46d69 100644 --- a/src/spur32.stack/gcc3x-interp.c +++ b/src/spur32.stack/gcc3x-interp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -612,6 +612,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2372,7 +2373,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt suppressHeartbeatFlag; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -26730,8 +26731,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -26750,10 +26761,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -26761,22 +26772,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -26788,15 +26799,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -26804,7 +26815,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -28510,6 +28634,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. diff --git a/src/spur32.stack/interp.c b/src/spur32.stack/interp.c index f4e49c5381..acc4b5f560 100644 --- a/src/spur32.stack/interp.c +++ b/src/spur32.stack/interp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -609,6 +609,7 @@ static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt addr static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); extern sqInt integerObjectOf(sqInt value); extern sqInt integerValueOf(sqInt oop); static sqInt NoDbgRegParms isFloatInstance(sqInt oop); @@ -2369,7 +2370,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt suppressHeartbeatFlag; char expensiveAsserts = 0; int (*showSurfaceFn)(sqIntptr_t, int, int, int, int); @@ -26721,8 +26722,18 @@ primitiveUninitializedNewWithArg(void) sqInt bs; sqInt ccIndex; sqInt classFormat; + sqInt classFormat1; + sqInt classIndex; + sqInt classObj; + sqInt err; sqInt fmt; + sqInt hash; sqInt instSpec; + sqInt instSpec1; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; sqInt obj; sqInt ok; sqInt oop; @@ -26741,10 +26752,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l10; + goto l19; } size = value; - goto l10; + goto l19; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -26752,22 +26763,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l9; - l9: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l18; + l18: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -26779,15 +26790,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l10; + goto l19; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l10; + goto l19; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l10: /* end positiveMachineIntegerValueOf: */; + l19: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -26795,7 +26806,120 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = PrimErrBadArgument; return; } - obj = instantiateUninitializedClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size); + /* begin instantiateUninitializedClass:indexableSize: */ + classObj = longAt(GIV(stackPointer) + (1 * BytesPerWord)); + classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec1)); + switch (instSpec1) { + case sixtyFourBitIndexableFormat(): + if (size > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + numSlots = size * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (size != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + } + numSlots = size; + break; + case firstShortFormat(): + numSlots = (size + 1) / 2; + instSpec1 += size & 1; + break; + case firstByteFormat(): + numSlots = (size + 3) / 4; + instSpec1 += (4 - size) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l14; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + obj = null; + goto l14; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + obj = null; + goto l14; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec1, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec1, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec1) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + obj = newObj; + l14: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); @@ -28501,6 +28625,131 @@ instantiateClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((longAt((classObj + BaseHeaderSize) + (((int)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 1); + instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); + classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((0x1FFFFFFF) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : (long32At(classObj + 4)) & (identityHashHalfWordMask())) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { + if (numSlots > (0x1FFFFFFF)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 + ? 8 /* allocationUnit */ + BaseHeaderSize + : ((numSlots + (numSlots & 1)) << (shiftForWord())) + ((numSlots >= (numSlotsMask()) + ? BaseHeaderSize + BaseHeaderSize + : BaseHeaderSize))), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = (BaseHeaderSize + BaseHeaderSize) + ((numSlots + (numSlots & 1)) * BytesPerOop); + } + else { + newObj1 = GIV(freeStart); + numBytes = BaseHeaderSize + ((numSlots <= 1 + ? /* begin allocationUnit */ 8 + : (numSlots + (numSlots & 1)) * BytesPerOop)); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + /* begin scheduleScavenge */ + GIV(needGCFlag) = 1; + forceInterruptCheck(); + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l8; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l8: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. diff --git a/src/spur32.stack/validImage.c b/src/spur32.stack/validImage.c index b1bc88c219..ee820e3a08 100644 --- a/src/spur32.stack/validImage.c +++ b/src/spur32.stack/validImage.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - ImageLeakChecker VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + ImageLeakChecker VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -257,6 +257,7 @@ static sqInt imageFormatVersion(void); static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt address); static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address); extern sqInt inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements); +extern sqInt instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements); static sqInt NoDbgRegParms integerObjectOf(sqInt value); static sqInt NoDbgRegParms isIntegerObject(sqInt oop); extern sqInt isIntegerValue(sqInt intValue); @@ -688,8 +689,8 @@ static struct foo { #else # define _iss static #endif -_iss sqInt nilObj; _iss usqInt freeStart; +_iss sqInt nilObj; _iss usqInt endOfMemory; _iss sqInt specialObjectsOop; _iss usqInt pastSpaceStart; @@ -704,11 +705,11 @@ _iss sqInt numSegments; _iss usqInt totalFreeOldSpace; _iss sqInt numClassTablePages; _iss sqInt classTableIndex; +_iss sqInt primFailCode; _iss sqInt rememberedSetSize; _iss sqInt weaklingStack; _iss char * objStackInvalidBecause; _iss sqInt invalidObjStackPage; -_iss sqInt primFailCode; _iss sqInt classNameIndex; _iss sqInt * rememberedSet; _iss sqInt remapBufferCount; @@ -720,14 +721,14 @@ _iss usqInt newSpaceStart; _iss sqInt numSegInfos; _iss sqInt classTableFirstPage; _iss sqInt mournQueue; +_iss usqInt scavengeThreshold; _iss sqInt verbose; _iss sqInt falseObj; +_iss sqInt needGCFlag; _iss sqInt rememberedSetLimit; -_iss usqInt scavengeThreshold; _iss sqInt trueObj; _iss sqInt edenBytes; _iss usqInt freeOldSpaceStart; -_iss sqInt needGCFlag; _iss sqInt firstSegmentSize; _iss sqInt becomeEffectsFlags; _iss sqInt canSwizzle; @@ -948,7 +949,7 @@ sqInt extraVMMemory; sqInt ffiExceptionResponse; sqInt inIOProcessEvents; struct VirtualMachine* interpreterProxy; -const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3198]"; sqInt suppressHeartbeatFlag; char expensiveAsserts = 0; volatile int sendTrace; @@ -2017,6 +2018,122 @@ inOldSpaceInstantiatePinnedClassindexableSize(sqInt classObj, usqInt nElements) } +/* Allocate an instance of a variable class, excepting CompiledMethod. */ + + /* Spur32BitMemoryManager>>#instantiateUninitializedClass:indexableSize: */ +sqInt +instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + sqInt classFormat; + sqInt classIndex; + sqInt err; + sqInt hash; + sqInt instSpec; + sqInt newObj; + usqInt newObj1; + usqInt numBytes; + usqInt numSlots; + + classFormat = ((fetchPointerofObject(InstanceSpecificationIndex, classObj)) >> 1); + instSpec = instSpecOfClassFormat(classFormat); + classIndex = rawHashBitsOf(classObj); + assert(isPureBitsFormat(instSpec)); + switch (instSpec) { + case sixtyFourBitIndexableFormat(): + if (nElements > ((maxSlotsForAlloc()) / 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + numSlots = nElements * 2; + break; + case firstLongFormat(): + if ((classIndex == ClassFloatCompactIndex) + && (nElements != 2)) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + } + numSlots = nElements; + break; + case firstShortFormat(): + numSlots = (nElements + 1) / 2; + instSpec += nElements & 1; + break; + case firstByteFormat(): + numSlots = (nElements + 3) / 4; + instSpec += (4 - nElements) & 3; + break; + default: + + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; + + } + if (classIndex == 0) { + /* begin ensureBehaviorHash: */ + assert(addressCouldBeClassObj(classObj)); + flag("todo"); + classIndex = (((hash = rawHashBitsOf(classObj))) != 0 + ? hash + : (objCouldBeClassObj(classObj) + ? (((err = enterIntoClassTable(classObj))) != 0 + ? -err + : rawHashBitsOf(classObj)) + : -PrimErrBadReceiver)); + if (classIndex < 0) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = -classIndex; + return null; + } + } + if (numSlots > (maxSlotsForNewSpaceAlloc())) { + if (numSlots > (maxSlotsForAlloc())) { + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrUnsupported; + return null; + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, objectBytesForSlots(numSlots), instSpec, classIndex); + } + else { + /* begin allocateSlots:format:classIndex: */ + if (numSlots >= (numSlotsMask())) { + newObj1 = GIV(freeStart) + BaseHeaderSize; + numBytes = largeObjectBytesForSlots(numSlots); + } + else { + newObj1 = GIV(freeStart); + numBytes = smallObjectBytesForSlots(numSlots); + } + if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) { + if (!GIV(needGCFlag)) { + } + newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); + goto l7; + } + if (numSlots >= (numSlotsMask())) { + + /* for header parsing we put a saturated slot count in the prepended overflow size word */ + flag("endianness"); + longAtput(GIV(freeStart), numSlots); + longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift())))); + long64Atput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex)); + } + else { + long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex); + } + assert((numBytes % (allocationUnit())) == 0); + assert((newObj1 % (allocationUnit())) == 0); + GIV(freeStart) += numBytes; + newObj = newObj1; + l7: /* end allocateSlots:format:classIndex: */; + } + return newObj; +} + + /* Convert the integer value, assumed to be in SmallInteger range, into a tagged SmallInteger object. In C, use a shift and an add to set the tag bit. diff --git a/src/spur64.cog/cogit.h b/src/spur64.cog/cogit.h index 97f1147b79..b3975cccfc 100644 --- a/src/spur64.cog/cogit.h +++ b/src/spur64.cog/cogit.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGenerator VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ diff --git a/src/spur64.cog/cointerp.c b/src/spur64.cog/cointerp.c index 87caf0c1cb..4659b47390 100644 --- a/src/spur64.cog/cointerp.c +++ b/src/spur64.cog/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2678,7 +2678,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -20441,7 +20441,7 @@ printFrameWithSP(char *theFP, char *theSP) usqInt index; sqInt methodField; usqInt numArgs; - sqInt numTemps; + usqInt numTemps; char *rcvrAddress; sqInt rcvrOrClosure; CogBlockMethod * self_in_cmHomeMethod; @@ -39333,7 +39333,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -39360,10 +39359,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -39371,22 +39370,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -39398,15 +39397,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -39419,7 +39418,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -39431,7 +39429,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -39446,19 +39444,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -39476,7 +39466,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -39484,7 +39474,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -39497,7 +39487,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -39515,7 +39505,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -39531,10 +39521,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -41396,7 +41386,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -41407,7 +41396,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -41433,18 +41421,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -41481,7 +41461,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -41499,7 +41479,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -41515,7 +41495,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } @@ -61757,7 +61737,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj))); contextSize = (sp >> 3); l6: /* end fetchStackPointerOf: */; - numPointerSlots = CtxtTempFrameStart + contextSize; + numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); goto l10; } /* begin numSlotsOf: */ @@ -61787,7 +61767,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((((header) & 7) == 1)); numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = numLiterals + LiteralStart; + numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -62338,7 +62318,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - sqInt node; + usqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; diff --git a/src/spur64.cog/cointerp.h b/src/spur64.cog/cointerp.h index bae1f8a1ab..b78b8827aa 100644 --- a/src/spur64.cog/cointerp.h +++ b/src/spur64.cog/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ diff --git a/src/spur64.cog/cointerpmt.c b/src/spur64.cog/cointerpmt.c index de8329ec91..36c8e7de7c 100644 --- a/src/spur64.cog/cointerpmt.c +++ b/src/spur64.cog/cointerpmt.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2771,7 +2771,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -35758,7 +35758,7 @@ primitiveInvokeObjectAsMethod(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt i; sqInt lookupClassTag; - sqInt runArgs; + usqInt runArgs; sqInt runReceiver; char *sp; char *sp1; @@ -42035,7 +42035,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -42062,10 +42061,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -42073,22 +42072,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -42100,15 +42099,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -42121,7 +42120,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -42133,7 +42131,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -42148,19 +42146,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -42178,7 +42168,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -42186,7 +42176,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -42199,7 +42189,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -42217,7 +42207,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -42233,10 +42223,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -44111,7 +44101,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -44122,7 +44111,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -44148,18 +44136,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -44196,7 +44176,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -44214,7 +44194,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -44230,7 +44210,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } @@ -58110,8 +58090,8 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; sqInt classIndex1; - sqInt clone1; - sqInt clone2; + usqInt clone1; + usqInt clone2; sqInt format; sqInt format1; sqInt hash; @@ -64490,7 +64470,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj))); contextSize = (sp >> 3); l6: /* end fetchStackPointerOf: */; - numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); + numPointerSlots = CtxtTempFrameStart + contextSize; goto l10; } /* begin numSlotsOf: */ @@ -64520,7 +64500,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((((header) & 7) == 1)); numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); + numPointerSlots = numLiterals + LiteralStart; l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -65071,7 +65051,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; diff --git a/src/spur64.cog/cointerpmt.h b/src/spur64.cog/cointerpmt.h index 3822f611a4..a01c1e5f49 100644 --- a/src/spur64.cog/cointerpmt.h +++ b/src/spur64.cog/cointerpmt.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ diff --git a/src/spur64.cog/gcc3x-cointerp.c b/src/spur64.cog/gcc3x-cointerp.c index 2de5154008..623a51ea4f 100644 --- a/src/spur64.cog/gcc3x-cointerp.c +++ b/src/spur64.cog/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2681,7 +2681,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -20450,7 +20450,7 @@ printFrameWithSP(char *theFP, char *theSP) usqInt index; sqInt methodField; usqInt numArgs; - sqInt numTemps; + usqInt numTemps; char *rcvrAddress; sqInt rcvrOrClosure; CogBlockMethod * self_in_cmHomeMethod; @@ -39342,7 +39342,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -39369,10 +39368,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -39380,22 +39379,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -39407,15 +39406,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -39428,7 +39427,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -39440,7 +39438,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -39455,19 +39453,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -39485,7 +39475,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -39493,7 +39483,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -39506,7 +39496,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -39524,7 +39514,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -39540,10 +39530,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -41405,7 +41395,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -41416,7 +41405,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -41442,18 +41430,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -41490,7 +41470,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -41508,7 +41488,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -41524,7 +41504,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } @@ -61766,7 +61746,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj))); contextSize = (sp >> 3); l6: /* end fetchStackPointerOf: */; - numPointerSlots = CtxtTempFrameStart + contextSize; + numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); goto l10; } /* begin numSlotsOf: */ @@ -61796,7 +61776,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((((header) & 7) == 1)); numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = numLiterals + LiteralStart; + numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -62347,7 +62327,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - sqInt node; + usqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; diff --git a/src/spur64.cog/gcc3x-cointerpmt.c b/src/spur64.cog/gcc3x-cointerpmt.c index e7a36275b0..c473f05172 100644 --- a/src/spur64.cog/gcc3x-cointerpmt.c +++ b/src/spur64.cog/gcc3x-cointerpmt.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2774,7 +2774,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -35767,7 +35767,7 @@ primitiveInvokeObjectAsMethod(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt i; sqInt lookupClassTag; - sqInt runArgs; + usqInt runArgs; sqInt runReceiver; char *sp; char *sp1; @@ -42044,7 +42044,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -42071,10 +42070,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -42082,22 +42081,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -42109,15 +42108,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -42130,7 +42129,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -42142,7 +42140,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -42157,19 +42155,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -42187,7 +42177,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -42195,7 +42185,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -42208,7 +42198,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -42226,7 +42216,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -42242,10 +42232,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -44120,7 +44110,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -44131,7 +44120,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -44157,18 +44145,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -44205,7 +44185,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -44223,7 +44203,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -44239,7 +44219,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } @@ -58119,8 +58099,8 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; sqInt classIndex1; - sqInt clone1; - sqInt clone2; + usqInt clone1; + usqInt clone2; sqInt format; sqInt format1; sqInt hash; @@ -64499,7 +64479,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj))); contextSize = (sp >> 3); l6: /* end fetchStackPointerOf: */; - numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize)); + numPointerSlots = CtxtTempFrameStart + contextSize; goto l10; } /* begin numSlotsOf: */ @@ -64529,7 +64509,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr) /* begin literalCountOfMethodHeader: */ assert((((header) & 7) == 1)); numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask; - numPointerSlots = ((usqInt) (numLiterals + LiteralStart)); + numPointerSlots = numLiterals + LiteralStart; l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */; if ((fmt <= 5 /* lastPointerFormat */) && (numPointerSlots > 0)) { @@ -65080,7 +65060,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; diff --git a/src/spur64.sista/cogit.h b/src/spur64.sista/cogit.h index 79db4b3364..38db4090a2 100644 --- a/src/spur64.sista/cogit.h +++ b/src/spur64.sista/cogit.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGenerator VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ diff --git a/src/spur64.sista/cointerp.c b/src/spur64.sista/cointerp.c index a4098c5db2..41f0cf56c4 100644 --- a/src/spur64.sista/cointerp.c +++ b/src/spur64.sista/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2692,7 +2692,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -23228,7 +23228,7 @@ printFrameWithSP(char *theFP, char *theSP) usqInt index; sqInt methodField; usqInt numArgs; - sqInt numTemps; + usqInt numTemps; char *rcvrAddress; sqInt rcvrOrClosure; CogBlockMethod * self_in_cmHomeMethod; @@ -42229,7 +42229,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -42256,10 +42255,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -42267,22 +42266,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -42294,15 +42293,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -42315,7 +42314,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -42327,7 +42325,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -42342,19 +42340,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -42372,7 +42362,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -42380,7 +42370,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -42393,7 +42383,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -42411,7 +42401,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -42427,10 +42417,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -44309,7 +44299,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -44320,7 +44309,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -44346,18 +44334,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -44394,7 +44374,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -44412,7 +44392,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -44428,7 +44408,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } @@ -65304,7 +65284,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -69086,8 +69066,8 @@ static sqInt getErrorObjectFromPrimFailCode(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - usqInt clone; - usqInt errObj; + sqInt clone; + sqInt errObj; sqInt fieldIndex; sqInt i; usqInt newObj; diff --git a/src/spur64.sista/cointerp.h b/src/spur64.sista/cointerp.h index 77a8bee9d6..701b9344de 100644 --- a/src/spur64.sista/cointerp.h +++ b/src/spur64.sista/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ diff --git a/src/spur64.sista/gcc3x-cointerp.c b/src/spur64.sista/gcc3x-cointerp.c index af7da2662f..e452ae0079 100644 --- a/src/spur64.sista/gcc3x-cointerp.c +++ b/src/spur64.sista/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2695,7 +2695,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; int displayWidth; int displayDepth; @@ -23237,7 +23237,7 @@ printFrameWithSP(char *theFP, char *theSP) usqInt index; sqInt methodField; usqInt numArgs; - sqInt numTemps; + usqInt numTemps; char *rcvrAddress; sqInt rcvrOrClosure; CogBlockMethod * self_in_cmHomeMethod; @@ -42238,7 +42238,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -42265,10 +42264,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -42276,22 +42275,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -42303,15 +42302,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -42324,7 +42323,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -42336,7 +42334,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -42351,19 +42349,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -42381,7 +42371,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -42389,7 +42379,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -42402,7 +42392,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -42420,7 +42410,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -42436,10 +42426,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -44318,7 +44308,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -44329,7 +44318,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -44355,18 +44343,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -44403,7 +44383,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -44421,7 +44401,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -44437,7 +44417,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } @@ -65313,7 +65293,7 @@ prepareForSnapshot(void) sqInt limit; sqInt newEndOfMemory; sqInt next; - usqInt node; + sqInt node; SpurSegmentInfo *seg; sqInt smallChild; sqInt treeNode; @@ -69095,8 +69075,8 @@ static sqInt getErrorObjectFromPrimFailCode(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt classIndex; - usqInt clone; - usqInt errObj; + sqInt clone; + sqInt errObj; sqInt fieldIndex; sqInt i; usqInt newObj; diff --git a/src/spur64.stack/gcc3x-interp.c b/src/spur64.stack/gcc3x-interp.c index 3961f0a39b..d0a539257c 100644 --- a/src/spur64.stack/gcc3x-interp.c +++ b/src/spur64.stack/gcc3x-interp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2391,7 +2391,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt suppressHeartbeatFlag; int displayWidth; int displayDepth; @@ -27519,7 +27519,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -27546,10 +27545,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -27557,22 +27556,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -27584,15 +27583,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -27605,7 +27604,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -27617,7 +27615,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -27632,19 +27630,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -27662,7 +27652,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -27670,7 +27660,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -27683,7 +27673,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -27701,7 +27691,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -27717,10 +27707,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -29510,7 +29500,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -29521,7 +29510,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -29547,18 +29535,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -29595,7 +29575,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -29613,7 +29593,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -29629,7 +29609,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } diff --git a/src/spur64.stack/interp.c b/src/spur64.stack/interp.c index 89dda7a265..2208074ca9 100644 --- a/src/spur64.stack/interp.c +++ b/src/spur64.stack/interp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2388,7 +2388,7 @@ sqInt debugCallbackInvokes; sqInt debugCallbackReturns; sqInt cannotDeferDisplayUpdates; sqInt checkedPluginName; -const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.3198]"; sqInt suppressHeartbeatFlag; int displayWidth; int displayDepth; @@ -27510,7 +27510,6 @@ primitiveUninitializedNewWithArg(void) sqInt classIndex; sqInt classObj; sqInt err; - sqInt fillValue; sqInt fmt; sqInt hash; sqInt instSpec; @@ -27537,10 +27536,10 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = null; - goto l17; + goto l18; } size = value; - goto l17; + goto l18; } if (((oop & (tagMask())) != 0)) { /* begin primitiveFail */ @@ -27548,22 +27547,22 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin isClassOfNonImm:equalTo:compactClassIndex: */ assert(!(isImmediate(oop))); /* begin classIndexOf: */ ccIndex = (longAt(oop)) & (classIndexMask()); ok = ClassLargePositiveIntegerCompactIndex == ccIndex; - goto l16; - l16: /* end isClassOfNonImm:equalTo:compactClassIndex: */; + goto l17; + l17: /* end isClassOfNonImm:equalTo:compactClassIndex: */; if (!ok) { /* begin primitiveFail */ if (!GIV(primFailCode)) { GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } /* begin numBytesOfBytes: */ fmt = (((usqInt)((longAt(oop)))) >> (formatShift())) & (formatMask()); @@ -27575,15 +27574,15 @@ primitiveUninitializedNewWithArg(void) GIV(primFailCode) = 1; } size = 0; - goto l17; + goto l18; } if (((sizeof(usqIntptr_t)) == 8) && (bs > 4)) { size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize)))); - goto l17; + goto l18; } size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize)))))); - l17: /* end positiveMachineIntegerValueOf: */; + l18: /* end positiveMachineIntegerValueOf: */; if (GIV(primFailCode)) { /* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */ @@ -27596,7 +27595,6 @@ primitiveUninitializedNewWithArg(void) classFormat1 = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec1 = (((usqInt)(classFormat1)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec1)); switch (instSpec1) { case sixtyFourBitIndexableFormat(): @@ -27608,7 +27606,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrBadReceiver; obj = null; - goto l12; + goto l13; } numSlots = (size + 1) / 2; instSpec1 += size & 1; @@ -27623,19 +27621,11 @@ primitiveUninitializedNewWithArg(void) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((size != 0) - || (instSpec1 > 5 /* lastPointerFormat */)) { - obj = null; - goto l12; - } - numSlots = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + obj = null; + goto l13; } if (classIndex == 0) { @@ -27653,7 +27643,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = -classIndex; obj = null; - goto l12; + goto l13; } } if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) { @@ -27661,7 +27651,7 @@ primitiveUninitializedNewWithArg(void) /* begin primitiveFailFor: */ GIV(primFailCode) = PrimErrUnsupported; obj = null; - goto l12; + goto l13; } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0 ? 8 /* allocationUnit */ + BaseHeaderSize @@ -27674,7 +27664,7 @@ primitiveUninitializedNewWithArg(void) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -27692,7 +27682,7 @@ primitiveUninitializedNewWithArg(void) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec1, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -27708,10 +27698,10 @@ primitiveUninitializedNewWithArg(void) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } obj = newObj; - l12: /* end instantiateUninitializedClass:indexableSize: */; + l13: /* end instantiateUninitializedClass:indexableSize: */; if (obj == null) { /* begin instSpecOfClass: */ classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); @@ -29501,7 +29491,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -29512,7 +29501,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3); instSpec = (((usqInt)(classFormat)) >> (fixedFieldsFieldWidth())) & (formatMask()); classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask()); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -29538,18 +29526,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > 5 /* lastPointerFormat */)) { - return null; - } - numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -29586,7 +29566,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l6; + goto l7; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop); @@ -29604,7 +29584,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) forceInterruptCheck(); } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l6; + goto l7; } if (numSlots >= (numSlotsMask())) { @@ -29620,7 +29600,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l6: /* end allocateSlots:format:classIndex: */; + l7: /* end allocateSlots:format:classIndex: */; } return newObj; } diff --git a/src/spur64.stack/validImage.c b/src/spur64.stack/validImage.c index 25420c8a7f..fc65df2ecb 100644 --- a/src/spur64.stack/validImage.c +++ b/src/spur64.stack/validImage.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 from - ImageLeakChecker VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 + ImageLeakChecker VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 */ -static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ; +static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3198 uuid: 10ccdad4-5851-42c4-9d31-841e6eafc085 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -714,9 +714,9 @@ _iss usqInt totalFreeOldSpace; _iss sqInt numClassTablePages; _iss sqInt classTableIndex; _iss sqInt rememberedSetSize; +_iss sqInt primFailCode; _iss sqInt weaklingStack; _iss char * objStackInvalidBecause; -_iss sqInt primFailCode; _iss sqInt invalidObjStackPage; _iss sqInt classNameIndex; _iss sqInt * rememberedSet; @@ -954,7 +954,7 @@ sqInt extraVMMemory; sqInt ffiExceptionResponse; sqInt inIOProcessEvents; struct VirtualMachine* interpreterProxy; -const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3197]"; +const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3198]"; sqInt suppressHeartbeatFlag; int displayDepth; int displayHeight; @@ -2036,7 +2036,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) sqInt classFormat; sqInt classIndex; sqInt err; - sqInt fillValue; sqInt hash; sqInt instSpec; sqInt newObj; @@ -2047,7 +2046,6 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) classFormat = ((fetchPointerofObject(InstanceSpecificationIndex, classObj)) >> 3); instSpec = instSpecOfClassFormat(classFormat); classIndex = rawHashBitsOf(classObj); - fillValue = 0; assert(isPureBitsFormat(instSpec)); switch (instSpec) { case sixtyFourBitIndexableFormat(): @@ -2073,18 +2071,10 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) break; default: - /* non-indexable */ - /* Some Squeak images include funky fixed subclasses of abstract variable - superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection. - The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via - this method. - Hence allow fixed classes to be instantiated here iff nElements = 0. */ - if ((nElements != 0) - || (instSpec > (lastPointerFormat()))) { - return null; - } - numSlots = fixedFieldsOfClassFormat(classFormat); - fillValue = GIV(nilObj); + /* not bits indexable */ + /* begin primitiveFailFor: */ + GIV(primFailCode) = PrimErrBadReceiver; + return null; } if (classIndex == 0) { @@ -2117,7 +2107,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (numSlots >= (numSlotsMask())) { if (((numSlots) >> 56) > 0) { newObj = null; - goto l5; + goto l6; } newObj1 = GIV(freeStart) + BaseHeaderSize; numBytes = largeObjectBytesForSlots(numSlots); @@ -2130,7 +2120,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) if (!GIV(needGCFlag)) { } newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex); - goto l5; + goto l6; } if (numSlots >= (numSlotsMask())) { @@ -2146,7 +2136,7 @@ instantiateUninitializedClassindexableSize(sqInt classObj, usqInt nElements) assert((newObj1 % (allocationUnit())) == 0); GIV(freeStart) += numBytes; newObj = newObj1; - l5: /* end allocateSlots:format:classIndex: */; + l6: /* end allocateSlots:format:classIndex: */; } return newObj; }