On Apr 12, 2010, at 5:16 PM, Igor Stasenko wrote:
> On 12 April 2010 17:43, Fernando olivero <[email protected]> wrote:
>> Good idea! I had a similar idea when initially worked on Alien loader.
>>
>> I think that what is needed also is remove the dependency with the array, i
>> mean explicitly calling the indexes make the image crash if you didn't had
>> the assumed special object array size.
>>
>>
>> For example:
>> Smalltalk registerSpecialObject: myObject with: aName
>>
>> And later you reference that special object by aName instead of an
>> index to the array.
>>
>>
>> So it would be easier to load/unload the packages that extend the special
>> objects array, because there would be no explicit dependency to indexes.
>>
> Yeah, that would be nice.
> But this will require VM changes.. and therefore is doomed :)
> Also, this could impact the VM speed significantly, because its using
> special object quite frequently.
> Imagine replacing a simple index-based lookup with name(string) based.
>
Hi Igor, i wasn't speaking of an on-image API change.
For example if you introduced the API you mentioned we could replace
Utilities>> initializeClosures
"Eliminate the prototype BlockContext from the specialObjectsArray.
The VM doesn't use it. This paves the way for removing BlockCOntext altogether
and merging ContextPart and MethodContext into e.g. Context."
(Smalltalk specialObjectsArray at: 38) class == BlockContext
ifTrue:[Smalltalk specialObjectsArray at: 38 put: nil].
With
Utilities>> initializeClosures
......
(Smalltalk hasSpecialObjectNamed: #BlockContext)
ifTrue:[ Smalltalk unregisterSpecialObjectNamed: #BlockContext
].
....
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project