Re: [Pharo-project] compiled method inherits from Collection?
Thanks for the info, its a shame we cant easily change the vm. Oh well, i should first ask for isCompiledMethod before isCollection now... Fernando On Tue, Jun 19, 2012 at 11:34 AM, Marcus Denker <marcus.denker@inria.fr> wrote:
On Jun 19, 2012, at 11:28 AM, Fernando Olivero wrote:
(Object>>#name) isCollection = true
Actually is a subclass of ByteArray (instead of collaborating with one).
Does this seem strange to anybody else? Is it really needed?
CompiledMethods are magical. Â They are highly optimized for saving space. If this is needed in 2012 where even a cellphone has half a gig of RAM is something that people are highly opinionated about.
And the special format of CompiledMethod is something the VM knows.
So: any change here means deep VM changes.
    Marcus
-- Marcus Denker -- http://marcusdenker.de
On 19.06.2012 11:46, Fernando Olivero wrote:
Thanks for the info, its a shame we cant easily change the vm.
Oh well, i should first ask for isCompiledMethod before isCollection now...
Fernando
Why? I mean, each CompiledMethod IS a collection of bytes, even though those bytes hold a special meaning. What do you do when you encounter normal ByteArrays? Cheers, Henry
On 19 June 2012 14:33, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 19.06.2012 11:46, Fernando Olivero wrote:
Thanks for the info, its a shame we cant easily change the vm.
Oh well, i should first ask for isCompiledMethod before isCollection now...
Fernando
Why? I mean, each CompiledMethod IS a collection of bytes, even though those bytes hold a special meaning. What do you do when you encounter normal ByteArrays?
i think CM inherit from Collection is abuse, and makes little sense: (Object>>#yourself) do: collect: select: add: remove: detect: so, only to reuse #at:/#at:put: ? but it could live with basicAt:/basicAt:put: just well.
Cheers, Henry
-- Best regards, Igor Stasenko.
It is historical to gain space. Now would be good to clean that but ⦠not yet.
Thanks for the info, its a shame we cant easily change the vm.
Oh well, i should first ask for isCompiledMethod before isCollection now...
Fernando
Why? I mean, each CompiledMethod IS a collection of bytes, even though those bytes hold a special meaning. What do you do when you encounter normal ByteArrays?
i think CM inherit from Collection is abuse, and makes little sense:
(Object>>#yourself) do: collect: select: add: remove: detect:
so, only to reuse #at:/#at:put: ?
but it could live with basicAt:/basicAt:put: just well.
Cheers, Henry
-- Best regards, Igor Stasenko.
On 19.06.2012 22:01, Igor Stasenko wrote:
On 19 June 2012 14:33, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 19.06.2012 11:46, Fernando Olivero wrote:
Thanks for the info, its a shame we cant easily change the vm.
Oh well, i should first ask for isCompiledMethod before isCollection now...
Fernando
Why? I mean, each CompiledMethod IS a collection of bytes, even though those bytes hold a special meaning. What do you do when you encounter normal ByteArrays?
i think CM inherit from Collection is abuse, and makes little sense:
(Object>>#yourself) do: collect: select: add: remove: detect:
so, only to reuse #at:/#at:put: ?
but it could live with basicAt:/basicAt:put: just well. Well, I tried changing it (proceeding all warnings not to do it) to a variableByteSubclass: of Object (which implements at:/at:put:). After recompileAll'ing, and then using a 1.4 image normally only a single sender of #last (CodeHolder>>#didCodeChangeElsewhere, seemed like a candidate to rewrite using trailer instead anyways) was encountered as user of collection methods.
At least it didn't crash the VM, so I guess it might be an option :) Cheers, Henry
impressive :)
but it could live with basicAt:/basicAt:put: just well. Well, I tried changing it (proceeding all warnings not to do it) to a variableByteSubclass: of Object (which implements at:/at:put:). After recompileAll'ing, and then using a 1.4 image normally only a single sender of #last (CodeHolder>>#didCodeChangeElsewhere, seemed like a candidate to rewrite using trailer instead anyways) was encountered as user of collection methods.
At least it didn't crash the VM, so I guess it might be an option :)
participants (4)
-
Fernando Olivero -
Henrik Sperre Johansen -
Igor Stasenko -
Stéphane Ducasse