Too many slots added to an object
Brian Rice
water at tunes.org
Mon Jun 7 12:13:45 PDT 2004
As mentioned by Lee on the IRC channel, this is obviously a current
limitation; 62 slots per object are the current maximum.
I believe that the solution requires in-place object replacement
(forwarding all pointers to the old object to the newly-made one with
correct capacity), which is possible or will be shortly, and is not
used in that code yet.
For now, you can basically add a namespace with the slots and have the
target namespace delegate to it (and do what Lee did which was to move
streams to their own delegated namespace to allow more room in
prototypes).
On Jun 7, 2004, at 3:16 AM, John Leuner wrote:
> I am getting this error from the bootstrapped VM:
>
> Slate: Added too many slots to an object.
>
>
> This is the code in vm.c:
>
> struct Object * PSObject_addSlotNamed_valued_at_(struct Object * obj,
> ObjectPointer name, ObjectPointer value, unsigned long int offset)
> {
> struct Object * newObj;
> struct Map * map;
> struct SlotEntry * entry;
>
> entry = PSSlotTable_hashEntryForName_((obj->map)->slotTable, name);
> if (entry != Nil)
> return Nil;
> * if ((obj->header).objectSize >= ObjectSizeMask)
> * error("Added too many slots to an object.");
> map = PSObjectHeap_cloneMap_(CurrentMemory, obj->map);
> PSObjectHeap_rootStackPush_(CurrentMemory, (ObjectPointer *) (&map));
> map->slotTable = PSSlotTable_growBy_excluding_(map->slotTable, 1,
> CurrentMemory->NilObject);
> PSSlotTable_relocate_by_(map->slotTable, offset, 4);
>
> It is triggered by the following code (some other code is loaded before
> this, but has never shown this kind of error until the following was
> added):
>
> prototypes addPrototype: #SrpMappingSaveRule derivedFrom: {Cloneable}.
> prototypes addPrototype: #PmrCollection derivedFrom:
> {SrpMappingSaveRule}.
> prototypes addPrototype: #PmrKeyedCollection derivedFrom:
> {PmrCollection}.
> prototypes addPrototype: #PmrDictionary derivedFrom:
> {PmrKeyedCollection}.
> prototypes addPrototype: #PmrIdentityDictionary derivedFrom:
> {PmrDictionary}.
> prototypes addPrototype: #PmrSequenceableCollection derivedFrom:
> {PmrCollection}.
> prototypes addPrototype: #PmrAdditiveSequenceableCollection
> derivedFrom:
> {PmrSequenceableCollection}.
>
>
> --
> John Leuner <jewel at pixie.co.za>
>
>
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/
More information about the Slate
mailing list