So far as I can see the method CompiledMethod>sourceClass is now
completely obsolete and its function is replaced by methodClass. Since the 3.9-7061 image seems to have all methods set up to have the methodClass is there any value in this potentially confusing extra function? There is one bit of confusion that seems to be related to the use of Traits though - (SystemNavigation default allMethodsNoDoitsSelect:[:cm| (cm sourceClass == cm methodClass) not ] produces a list of methods where the two messages produce different results. It seems that for example Behavior >> #isLocalAliasSelector: has a methodClass of 'Behavior' as one might expect but a sourceClass of ' TAccessingTraitCompositionBehavior' which I wouldn't expect. Why? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- Has a pulse, but that's about all. |
2006/10/10, tim Rowledge <[hidden email]>:
> So far as I can see the method CompiledMethod>sourceClass is now > completely obsolete and its function is replaced by methodClass. > Since the 3.9-7061 image seems to have all methods set up to have the > methodClass is there any value in this potentially confusing extra > function? > > There is one bit of confusion that seems to be related to the use of > Traits though - > (SystemNavigation default allMethodsNoDoitsSelect:[:cm| > (cm sourceClass == cm methodClass) not ] > produces a list of methods where the two messages produce different > results. It seems that for example > Behavior >> #isLocalAliasSelector: > has a methodClass of 'Behavior' as one might expect but a sourceClass > of ' TAccessingTraitCompositionBehavior' which I wouldn't expect. Why? Because its a method of a trait? Philippe |
On 9-Oct-06, at 10:08 PM, Philippe Marschall wrote: > 2006/10/10, tim Rowledge <[hidden email]>: >> There is one bit of confusion that seems to be related to the use of >> Traits though - >> (SystemNavigation default allMethodsNoDoitsSelect:[:cm| >> (cm sourceClass == cm methodClass) not ] >> produces a list of methods where the two messages produce different >> results. It seems that for example >> Behavior >> #isLocalAliasSelector: >> has a methodClass of 'Behavior' as one might expect but a sourceClass >> of ' TAccessingTraitCompositionBehavior' which I wouldn't expect. >> Why? > > Because its a method of a trait? reason for such a split. I might well just be a side effect of the introduction of method properties for example. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Decafalon (n.): The grueling event of getting through the day consuming only things that are good for you. |
On 10.10.2006, at 07:33, tim Rowledge wrote: > > On 9-Oct-06, at 10:08 PM, Philippe Marschall wrote: > >> 2006/10/10, tim Rowledge <[hidden email]>: >>> There is one bit of confusion that seems to be related to the use of >>> Traits though - >>> (SystemNavigation default allMethodsNoDoitsSelect:[:cm| >>> (cm sourceClass == cm methodClass) not ] >>> produces a list of methods where the two messages produce different >>> results. It seems that for example >>> Behavior >> #isLocalAliasSelector: >>> has a methodClass of 'Behavior' as one might expect but a >>> sourceClass >>> of ' TAccessingTraitCompositionBehavior' which I wouldn't expect. >>> Why? >> >> Because its a method of a trait? > Well, sure it's a trait but I don't see why that would be a good > reason for such a split. I might well just be a side effect of the > introduction of method properties for example. No... so for explanation: Traits share CompiledMethods (if there is no super in them). So when you asked the (prior to properties) for #who, the answer was random: in what ever class or Traits the method was found first, this was returned as the class. When I then added properties (and having CompildMethods know their class/selector) the question was: Does this ill-defined #who now mean I can't add the class/selector to compiledMethods? It was broken before, and it would be broken after (because shared compiledMethods would have only one, random #methodClass). So I could not do the properties/pragmas and wait for Traits to be fixed. Fixing could be done afterwards, too. So I opted for introducing the fast #who that stores class and selector in the method. For Traits, this now leads to undefined results, as did #who before. This should be fixed, of course. There are three alternatives: 1) allways return the Trait on #methodClass, 2) give up CompiledMethod sharing alltogether or 3) have CompiledMethods be real Objects and share the ByteCode ByteArray and the literals. So.. best would be 3), but this seems to be off for at least 8 other years, so I guess it would be 1) first and later maybe 2, as the CompiledMethod sharing makes not much sense as soon as CompiledMethods know something about where they are in the system. Marcus |
Marcus,
what happened after - http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-July/106543.html with which we asserted that every CompiledMethod's methodClass's methodDict includes the method (itself). So, reflecting the 3 options you listed below, it ought to be option 2? I confirm that the above is no longer the case, has something broken again. /Klaus On Tue, 10 Oct 2006 09:14:20 +0200, Marcus Denker wrote: > On 10.10.2006, at 07:33, tim Rowledge wrote: >> On 9-Oct-06, at 10:08 PM, Philippe Marschall wrote: >>> 2006/10/10, tim Rowledge <[hidden email]>: >>>> There is one bit of confusion that seems to be related to the use of >>>> Traits though - >>>> (SystemNavigation default allMethodsNoDoitsSelect:[:cm| >>>> (cm sourceClass == cm methodClass) not ] >>>> produces a list of methods where the two messages produce different >>>> results. It seems that for example >>>> Behavior >> #isLocalAliasSelector: >>>> has a methodClass of 'Behavior' as one might expect but a sourceClass >>>> of ' TAccessingTraitCompositionBehavior' which I wouldn't expect. Why? >>> >>> Because its a method of a trait? >> Well, sure it's a trait but I don't see why that would be a good reason >> for such a split. I might well just be a side effect of the >> introduction of method properties for example. > > No... so for explanation: Traits share CompiledMethods (if there is no > super in them). > > So when you asked the (prior to properties) for #who, the answer was > random: in what ever class or Traits the method was found first, this > was returned as the class. > > When I then added properties (and having CompildMethods know their > class/selector) the question was: Does this ill-defined #who now mean I > can't add > the class/selector to compiledMethods? It was broken before, and it > would be broken after (because shared compiledMethods would have only > one, random > #methodClass). So I could not do the properties/pragmas and wait for > Traits to be fixed. Fixing could be done afterwards, too. So I opted > for introducing the fast > #who that stores class and selector in the method. > > For Traits, this now leads to undefined results, as did #who before. > This should be fixed, of course. There are three alternatives: 1) > allways return the Trait on > #methodClass, 2) give up CompiledMethod sharing alltogether or 3) have > CompiledMethods be real Objects and share the ByteCode ByteArray and the > literals. > > So.. best would be 3), but this seems to be off for at least 8 other > years, so I guess it would be 1) first and later maybe 2, as the > CompiledMethod sharing makes > not much sense as soon as CompiledMethods know something about where > they are in the system. > > Marcus > > |
On 10.10.2006, at 10:29, Klaus D. Witzel wrote: > Marcus, > > what happened after > > - http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-July/ > 106543.html > > with which we asserted that every CompiledMethod's methodClass's > methodDict includes the method (itself). > > So, reflecting the 3 options you listed below, it ought to be > option 2? > > I confirm that the above is no longer the case, has something > broken again. > " every CompiledMethod's methodClass's methodDict includes the method (itself)." is true even when "methodClass" returns the Trait in all cases. (as the method is installed in the trait". What is false right now is "every CompiledMethod's methodClass's methodDict includes the method (itself) and is contained in no other methodDict". I think the stup we have right now should already be setup to return the Trait on methodClass: This is the only case where the method is installed for real, so methodClass is set at that point. The sharing-entry that happens when a Trait gets included in a class does not re-set the methodClass (I think, should be checked). So a "methodClass" returns a class or a Trait. if it returns a Trait, this trait then can be queried for all classes that it is installed in. Marcus > /Klaus > > On Tue, 10 Oct 2006 09:14:20 +0200, Marcus Denker wrote: >> On 10.10.2006, at 07:33, tim Rowledge wrote: >>> On 9-Oct-06, at 10:08 PM, Philippe Marschall wrote: >>>> 2006/10/10, tim Rowledge <[hidden email]>: >>>>> There is one bit of confusion that seems to be related to the >>>>> use of >>>>> Traits though - >>>>> (SystemNavigation default allMethodsNoDoitsSelect:[:cm| >>>>> (cm sourceClass == cm methodClass) not ] >>>>> produces a list of methods where the two messages produce >>>>> different >>>>> results. It seems that for example >>>>> Behavior >> #isLocalAliasSelector: >>>>> has a methodClass of 'Behavior' as one might expect but a >>>>> sourceClass >>>>> of ' TAccessingTraitCompositionBehavior' which I wouldn't >>>>> expect. Why? >>>> >>>> Because its a method of a trait? >>> Well, sure it's a trait but I don't see why that would be a good >>> reason for such a split. I might well just be a side effect of >>> the introduction of method properties for example. >> >> No... so for explanation: Traits share CompiledMethods (if there >> is no super in them). >> >> So when you asked the (prior to properties) for #who, the answer >> was random: in what ever class or Traits the method was found >> first, this was returned as the class. >> >> When I then added properties (and having CompildMethods know their >> class/selector) the question was: Does this ill-defined #who now >> mean I can't add >> the class/selector to compiledMethods? It was broken before, and >> it would be broken after (because shared compiledMethods would >> have only one, random >> #methodClass). So I could not do the properties/pragmas and wait >> for Traits to be fixed. Fixing could be done afterwards, too. So >> I opted for introducing the fast >> #who that stores class and selector in the method. >> >> For Traits, this now leads to undefined results, as did #who >> before. This should be fixed, of course. There are three >> alternatives: 1) allways return the Trait on >> #methodClass, 2) give up CompiledMethod sharing alltogether or 3) >> have CompiledMethods be real Objects and share the ByteCode >> ByteArray and the literals. >> >> So.. best would be 3), but this seems to be off for at least 8 >> other years, so I guess it would be 1) first and later maybe 2, as >> the CompiledMethod sharing makes >> not much sense as soon as CompiledMethods know something about >> where they are in the system. >> >> Marcus >> >> > > > |
Hi Marcus,
> So a "methodClass" returns a class or a Trait. if it returns > a Trait, this trait then can be queried for all classes that it is > installed in. Yeah, that makes sense. kiss. /Klaus On Tue, 10 Oct 2006 10:57:18 +0200, Marcus wrote: > On 10.10.2006, at 10:29, Klaus D. Witzel wrote: > >> Marcus, >> >> what happened after >> >> - http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-July/ >> 106543.html >> >> with which we asserted that every CompiledMethod's methodClass's >> methodDict includes the method (itself). >> >> So, reflecting the 3 options you listed below, it ought to be option 2? >> >> I confirm that the above is no longer the case, has something broken >> again. >> > > " every CompiledMethod's methodClass's methodDict includes the method > (itself)." is true even when "methodClass" > returns the Trait in all cases. (as the method is installed in the > trait". > What is false right now is "every CompiledMethod's methodClass's > methodDict includes the method (itself) and is contained in > no other methodDict". > > I think the stup we have right now should already be setup to return the > Trait on methodClass: This is the only case where > the method is installed for real, so methodClass is set at that point. > The sharing-entry that happens when a Trait gets included > in a class does not re-set the methodClass (I think, should be checked). > So a "methodClass" returns a class or a Trait. if it returns > a Trait, this trait then can be queried for all classes that it is > installed in. > > Marcus > >> /Klaus >> >> On Tue, 10 Oct 2006 09:14:20 +0200, Marcus Denker wrote: >>> On 10.10.2006, at 07:33, tim Rowledge wrote: >>>> On 9-Oct-06, at 10:08 PM, Philippe Marschall wrote: >>>>> 2006/10/10, tim Rowledge <[hidden email]>: >>>>>> There is one bit of confusion that seems to be related to the use of >>>>>> Traits though - >>>>>> (SystemNavigation default allMethodsNoDoitsSelect:[:cm| >>>>>> (cm sourceClass == cm methodClass) not ] >>>>>> produces a list of methods where the two messages produce different >>>>>> results. It seems that for example >>>>>> Behavior >> #isLocalAliasSelector: >>>>>> has a methodClass of 'Behavior' as one might expect but a >>>>>> sourceClass >>>>>> of ' TAccessingTraitCompositionBehavior' which I wouldn't expect. >>>>>> Why? >>>>> >>>>> Because its a method of a trait? >>>> Well, sure it's a trait but I don't see why that would be a good >>>> reason for such a split. I might well just be a side effect of the >>>> introduction of method properties for example. >>> >>> No... so for explanation: Traits share CompiledMethods (if there is no >>> super in them). >>> >>> So when you asked the (prior to properties) for #who, the answer was >>> random: in what ever class or Traits the method was found first, this >>> was returned as the class. >>> >>> When I then added properties (and having CompildMethods know their >>> class/selector) the question was: Does this ill-defined #who now mean >>> I can't add >>> the class/selector to compiledMethods? It was broken before, and it >>> would be broken after (because shared compiledMethods would have only >>> one, random >>> #methodClass). So I could not do the properties/pragmas and wait for >>> Traits to be fixed. Fixing could be done afterwards, too. So I opted >>> for introducing the fast >>> #who that stores class and selector in the method. >>> >>> For Traits, this now leads to undefined results, as did #who before. >>> This should be fixed, of course. There are three alternatives: 1) >>> allways return the Trait on >>> #methodClass, 2) give up CompiledMethod sharing alltogether or 3) have >>> CompiledMethods be real Objects and share the ByteCode ByteArray and >>> the literals. >>> >>> So.. best would be 3), but this seems to be off for at least 8 other >>> years, so I guess it would be 1) first and later maybe 2, as the >>> CompiledMethod sharing makes >>> not much sense as soon as CompiledMethods know something about where >>> they are in the system. >>> >>> Marcus >>> >>> >> >> >> > > > |
In reply to this post by Marcus Denker
Marcus Denker wrote:
> I think the setup we have right now should already be set up to return the > Trait on methodClass: This is the only case where > the method is installed for real, so methodClass is set at that point. Not necessarily true. A method which includes a super-send cannot point to the trait in its method class - if it did it would explode right under your feet. > The sharing-entry that happens when a Trait gets included > in a class does not re-set the methodClass (I think, should be checked). That better not be true for methods with super sends. > So a "methodClass" returns a class or a Trait. if it returns > a Trait, this trait then can be queried for all classes that it is > installed in. This seems wrong. It should always return the class it *installed* in, never the trait it is *defined* in. Cheers, - Andreas |
In reply to this post by Marcus Denker
Hi,
.snip... > For Traits, this now leads to undefined results, as did #who before. > This should be fixed, of course. There are three alternatives: 1) > allways return the Trait on > #methodClass, 2) give up CompiledMethod sharing alltogether or 3) > have CompiledMethods be real Objects and share the ByteCode ByteArray > and the literals. > > So.. best would be 3), but this seems to be off for at least 8 other > years, so I guess it would be 1) first and later maybe 2, as the > CompiledMethod sharing makes > not much sense as soon as CompiledMethods know something about where > they are in the system. Method sharing, appears to me, to be an optimization (of memory/ image size) which causes some problems. I wonder how much space is actually saved by this sharing, are any numbers available? I also wonder about up-and-coming technologies like Exupery & Spoon, and whether they would have any problems with shared CompiledMethods. There is also the Traits-with-state / Stateful Traits research (which I haven't had time to look into). Can anyone comment on whether that will require, or prohibit, method sharing? My preference would be for option 2 - give up method sharing. Then all trait methods are treated in a consistent manner and the problems with sharing are avoided, albeit at the expense of increased image size/ memory usage. Option 3 also sounds good - I shall ponder it over the next 8 years ;) Cheers, Andy |
In reply to this post by Andreas.Raab
On 10.10.2006, at 11:20, Andreas Raab wrote: > Marcus Denker wrote: >> I think the setup we have right now should already be set up to >> return the Trait on methodClass: This is the only case where >> the method is installed for real, so methodClass is set at that >> point. > > Not necessarily true. A method which includes a super-send cannot > point to the trait in its method class - if it did it would explode > right under your feet. > Ups, yes, minus those methods with super sends. >> The sharing-entry that happens when a Trait gets included >> in a class does not re-set the methodClass (I think, should be >> checked). > > That better not be true for methods with super sends. > >> So a "methodClass" returns a class or a Trait. if it returns >> a Trait, this trait then can be queried for all classes that it is >> installed in. > > This seems wrong. It should always return the class it *installed* > in, never the trait it is *defined* in. > But right now (when there is no super in it) those are all the same method. (Methods are shared for saving space). So the solution would be to never share, allways copy. The machinary now used for super send methods should be used for all methods, and we are done. Space saving then can be added again after we make CompiledMethods normal objects (with a ByteArray containing the Bytecode another array for the literals). Then these can be shared to save space, while the Method itself will be a copy. The fun thing is that the CompiledMethod special treatment was done to save space (rightly, there are lots of methods!). But then, when there is more RAM, people tend to like the idea of trading RAM for more powerful abstractions. e.g having classes now their class and name. In the end, we are soon at a point where the specia treatment of CompiledMethod does not save memory, but it costs memory for all the hacks build around it to support what we would get for free if it would be a standard object... so having CompiledMethods be normal Objects is definitly the right thing (which it was in 1998 already, I might add). What should have been in in the 90ties would have been a "Squeak revisited", a simplifcation and generalisation pass, based on the fact that the world was different in 1997 than it was in 1977. A more simple and general system of course makes it much easier then to re-start hacking and experimenting (e.g. for eToys), thus it is even the right thing to do from a "Kids first" perspective. That sadly never was done, work done in that direction was even completely ignored and rejected. Marcus |
In reply to this post by Marcus Denker
On 10-Oct-06, at 12:14 AM, Marcus Denker wrote: > [snip] > No... so for explanation: Traits share CompiledMethods (if there is > no super in them). Ah-hah. I thought they copied down. > > So when you asked the (prior to properties) for #who, the answer > was random: in what ever class or Traits the method was found > first, this was returned as the class. That be would bad (sorry, words in order as found :-) [snip] > > For Traits, this now leads to undefined results, as did #who > before. This should be fixed, of course. There are three > alternatives: 1) allways return the Trait on > #methodClass, 2) give up CompiledMethod sharing alltogether or 3) > have CompiledMethods be real Objects and share the ByteCode > ByteArray and the literals. > > So.. best would be 3), but this seems to be off for at least 8 > other years, > so I guess it would be 1) first and later maybe 2, as the > CompiledMethod sharing makes > not much sense as soon as CompiledMethods know something about > where they are in the system. Yes, I think that having the method include the method class is essentially the same barrier to cm sharing (until 1) above) as having a super in the code. Is it practical to fix this very soon? Obviously the code to cope with a non-shared trait method is in place so could we just kill the shared case for now and re-wiggle the currently shared cases? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- Low on thinking gas. |
In reply to this post by Marcus Denker
On 10-Oct-06, at 3:03 AM, Marcus Denker wrote: [snip] > > But right now (when there is no super in it) those are all the same > method. (Methods are shared for saving > space). > > So the solution would be to never share, allways copy. The > machinary now used for super send methods should > be used for all methods, and we are done. I concur - this seems like the proper answer for now. > > Space saving then can be added again after we make CompiledMethods > normal objects (with a ByteArray containing > the Bytecode another array for the literals). Then these can be > shared to save space, while the Method itself will be > a copy. Yup. > > The fun thing is that the CompiledMethod special treatment was done > to save space (rightly, there are lots of methods!). > But then, when there is more RAM, people tend to like the idea of > trading RAM for more powerful abstractions. e.g having > classes now their class and name. In the end, we are soon at a > point where the specia treatment of CompiledMethod does > not save memory, but it costs memory for all the hacks build around > it to support what we would get for free if it would be > a standard object... so having CompiledMethods be normal Objects is > definitly the right thing (which it was in 1998 already, > I might add). never got organised enough to escape it. > > What should have been in in the 90ties would have been a "Squeak > revisited", a simplifcation and generalisation pass, based > on the fact that the world was different in 1997 than it was in > 1977. A more simple and general system of course makes it much > easier then to re-start hacking and experimenting (e.g. for eToys), > thus it is even the right thing to do from a "Kids first" perspective. > That sadly never was done, work done in that direction was even > completely ignored and rejected. Too true. But there's nothing (aside from real life...) getting in the way of doing it now. All we need is about $5m a year. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim "How many Kdatlyno does it take to change a lightbulb?" "None. It sounds perfectly OK to them." |
In reply to this post by Andrew Tween
Hi Andrew-- > I also wonder about up-and-coming technologies like Exupery & Spoon, > and whether they would have any problems with shared CompiledMethods. Spoon wouldn't; it's already sharing them across machines. -C -- Craig Latta http://netjam.org/resume |
In reply to this post by timrowledge
On 10.10.2006, at 18:11, tim Rowledge wrote: > >> so I guess it would be 1) first and later maybe 2, as the >> CompiledMethod sharing makes >> not much sense as soon as CompiledMethods know something about >> where they are in the system. > > Yes, I think that having the method include the method class is > essentially the same barrier to cm sharing (until 1) above) as > having a super in the code. Is it practical to fix this very soon? > Obviously the code to cope with a non-shared trait method is in > place so could we just kill the shared case for now and re-wiggle > the currently shared cases? > It should not be impossible to fix, but it would need to be done... maybe adrian has an idea of how much work it would be? Marcus |
In reply to this post by Andrew Tween
Andrew Tween writes:
> I also wonder about up-and-coming technologies like Exupery & Spoon, and whether > they would have any problems with shared CompiledMethods. Exupery doesn't really care. It asks for a compiled method for a class and a selector then compiles it. Once per receiver, a bit wasteful but it makes it easier to specialize primitives. Also, you need to de-compile methods if a compiled method is changed. That might need a little work with traits, but not enough to worry about. Bryce |
In reply to this post by timrowledge
You lost my in translation....
So I will chat with marcus to get it :) |
Free forum by Nabble | Edit this page |