On Mon, Mar 19, 2012 at 10:01:23AM -0700, Eliot Miranda wrote:
Hi Guillermo,
On Sun, Mar 18, 2012 at 5:46 PM, Guillermo Polito <guillermopolito@gmail.com
wrote:
What about changing #recreateSpecialObjectsArray so having in mind some classes like Bitmap or Display may not be in the kernel? This only changes some lines like:
... newArray at: 5 put: (self at: #Bitmap ifAbsent: [ nil ]).
...
newArray at: 13 put: (self at: #Point ifAbsent: [ nil ]).
...
newArray at: 15 put: (self at: #Display ifAbsent: [ nil ]).
...
newArray at: 34 put: (self at: #Point ifPresent: [ :cls | 0@0]
ifAbsent: [ nil ]).
The last one isn't used in Cog (in fact indices 32, 33 & 34 are unused) and probably unused in the Interpreter. David?
Good question. I took a quick look at senders of #splObj: and I do not see any usage of these entries in the special objects array. It appears that the entries are (or were) intended to support fast object initialization:
"Prototype instances that can be copied for fast initialization" newArray at: 32 put: (Float new: 2). newArray at: 33 put: (LargePositiveInteger new: 4). newArray at: 34 put: Point new.
I cannot guarantee that these entries are unused, but it may well be that they are obsolete.
I guess one way to confirm this is to nil them out in the array and see what breaks.
Dave