Condensed Sources vs. Squeak Maintainence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Klaus D. Witzel
On Wed, 26 Jul 2006 08:48:21 +0200, Marcus Denker wrote:

> On 26.07.2006, at 07:36, Klaus D. Witzel wrote:
>> ... May I stress that my concern is the *current*
>> *integrity* of
>>
>> (nil systemNavigation
>> allMethodsSelect: [:method |
>> method hasNewPropertyFormat == false]) size
>> => 0
>
> All methods have been recompiled to use the new format (with class
> binding in last literal)
>
>>
>> |x y | x := y := 0.
>> nil systemNavigation
>> allMethodsSelect: [:method |
>> method literals last isVariableBinding
>> ifTrue: [x := 1 + x]
>> ifFalse: [y := 1 + y]. false].
>> x @ y => 49487@0
>>
>> |x y | x := y := 0.
>> CompiledMethod allInstancesDo: [:z |
>> z literals last isVariableBinding
>> ifTrue: [x := 1 + x]
>> ifFalse: [y := 1 + y]].
>> x@y => 49035@5
>>
>> (note the discrepancy, 49487 versus 49035,
>
> non-locally intalled traits methods.

Aha, I already assumed this was related to traits. Thank you for the  
confirmation.

>> 0 versus 5, relative to 3.9#7048)
>>
>
> There are some methods on the stack that have not yet finished
> executing... should be fixed.
>   It's on the never-ending list of stuff on the todo.

O.K. will have a look at what can be stolen from Pavel's kernel w.r.t.  
re-instantiating the as yet not terminated processes.

In adition, would you please review this line of thought: if we already  
had the new ObsoleteMethods feature, we'd know exactly which ones (of the  
still executing methods) that are. Thank you for you time.

>> But aCompiledMethod methodClass ... This must be as
>> reliable as possible, otherwise we can forget about
>> aCompiledMethod>>#= for use in any other (sub)system. No, it's not
>> my intention to invent something which is ersatz (<= WordNet/2.1)
>> for aCompiledMethod>>#=.
>>
>
> #= does not take the Class of the method into account, as any client
> for equality would not want that.

I repeat my argument ( >= 3 postings ago): any two classes must have (by  
definition) ~= type, so their methods. Please confirm or refute, if an  
answer is possible, thank you in advance.

> You want to ask "which methods are
> the same in the system".

Do I? Do I want to know that two methods which are defined for two ~=  
types (classes) both access the i-th instance variable in their local  
(hidden, encapsulated) state?

> If we
> take the Class into account, you will never find any equeal methods...

Hhm. Do you suggest that we can get rid of aCompiledMethod>>#= because  
there is not much sensible use of it anyways (see my point on the i-th  
instVar of two ~= types)?

So what do we need for finding out whether or not the compiler has made  
two methods from exactly the same or from guaranteed different entries in  
the new source code subsystem (a question which cannot be answered by  
querying the [most likely remote] source code subsystem)? Do we need  
"just" meta data and never ask aCompiledMethod>>#= ?

When does a method become a new (a different) version? Because the [most  
likely remote] new source code subsystem dictates so <joke> http push:  
sourceCode newVersion: true </joke>. Or because any two  
aCompiledMethod>>#= tell so?

[take my apologies for the many ?'s]

>> A nice and bad (perhaps no *that* close but nevertheless
>> frightening) example is ChangeRecord>>#methodClass, it asks
>> Smalltalk (regardless of obsolence)...
>> words and in a single statement: clean up the #methodClass mess in
>> the image.
>
> The whole fileOut / Changes stuff os a huge huge mess. But
> #methodClass in ChangeRecord has not much to do with #methodClass on
> CompiledMethod...

OhhKay, lame example ;-) But frightening, isn't it.

> Seriously, the only way to improve the situation is to improve it...
> we had many people telling that only perfect solutions are
> acceptable.

I never had the time ( == my customers never had the time) for waiting for  
/ or doing a perfect solution. We're in sync (I know you knew that).

> Or worthy of Squeak
> or something. This is wrong: We need *better* solutions, not perfect
> ones.

Yes, better quality than quantity.

> If we would have just made everything continously a little bit
> better over the last
> 10 years, we would have quite a cool system now.
>
> The idea of searching for the "perfect" solution only (while letting
> everything rot) is the reason for a lot of what we see now.

...while letting everything *else* rot... yes, agreed.

/Klaus

>         Marcus


Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Andreas.Raab
In reply to this post by Marcus Denker
Marcus Denker wrote:
> There are some methods on the stack that have not yet finished
> executing... should be fixed.
>  It's on the never-ending list of stuff on the todo.

Try the following - for Croquet (3.8) this fixed all methods still in use:


   WeakArray restartFinalizationProcess.
   MethodChangeRecord allInstancesDo:[:x| x noteNewMethod: nil].
   Delay startTimerInterruptWatcher.
   WorldState allInstancesDo:[:ws| ws convertAlarms; convertStepList].
   ExternalDropHandler initialize.
   ScrollBar initializeImagesCache.
   SokobanMorph initFields.
   Vocabulary initialize.
   GradientFillStyle initPixelRampCache.
   Smalltalk garbageCollect.
   (CompiledMethod allInstances
        reject:[:cm| cm hasNewPropertyFormat]) inspect.
       
Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Klaus D. Witzel
Thank you Andreas. After nilifying the classVars of ProcessBrowser the  
inspector showed an empty array :-)

/Klaus

On Wed, 26 Jul 2006 10:58:18 +0200, Andreas Raab <[hidden email]>  
wrote:

> WeakArray restartFinalizationProcess.
>   MethodChangeRecord allInstancesDo:[:x| x noteNewMethod: nil].
>   Delay startTimerInterruptWatcher.
>   WorldState allInstancesDo:[:ws| ws convertAlarms; convertStepList].
>   ExternalDropHandler initialize.
>   ScrollBar initializeImagesCache.
>   SokobanMorph initFields.
>   Vocabulary initialize.
>   GradientFillStyle initPixelRampCache.
>   Smalltalk garbageCollect.
>   (CompiledMethod allInstances
> reject:[:cm| cm hasNewPropertyFormat]) inspect.



Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Klaus D. Witzel
Marcus,

attached is the related test case. Would you please condition the next to  
come image with Andreas' *massive* know how and my humble nilifying  
addition, thanks in advance.

/Klaus

On Wed, 26 Jul 2006 11:16:28 +0200, Klaus D. Witzel wrote:

> Thank you Andreas. After nilifying the classVars of ProcessBrowser the  
> inspector showed an empty array :-)
>
> /Klaus
>
> On Wed, 26 Jul 2006 10:58:18 +0200, Andreas Raab wrote:
>
>> WeakArray restartFinalizationProcess.
>>   MethodChangeRecord allInstancesDo:[:x| x noteNewMethod: nil].
>>   Delay startTimerInterruptWatcher.
>>   WorldState allInstancesDo:[:ws| ws convertAlarms; convertStepList].
>>   ExternalDropHandler initialize.
>>   ScrollBar initializeImagesCache.
>>   SokobanMorph initFields.
>>   Vocabulary initialize.
>>   GradientFillStyle initPixelRampCache.
>>   Smalltalk garbageCollect.
>>   (CompiledMethod allInstances
>> reject:[:cm| cm hasNewPropertyFormat]) inspect.
>
>
>
>



MethodPropertiesTest-kwl.1.cs (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass [was: Condensed Sources vs. Squeak Maintainence]

stéphane ducasse-2
In reply to this post by Andreas.Raab
> Actually, if you want my attention, talk about the new source code  
> subsystem ;-)
>
> The method properties discussion is a red herring in my eyes - we  
> have a functioning version today and if that needs changing or not  
> is in the eye of the beholder. Personally (having done it both  
> ways) I strongly prefer the current solution since it has some nice  
> properties (like that all relevant attributes are reachable via  
> direct references from the method and therefore garbage collection  
> will do The Right Thing without additional help; that a generic  
> copying mechanism doesn't have to know that some vital parts of  
> compiled methods are stored elsewhere; that extensions can be done  
> in one place rather than many) but things can certainly be done  
> differently. Discussing those merits would require some more data  
> points other than saying "yes, it can be done" (because I know it  
> can, I have done it before ;-) and would likely mean some fairly  
> subjective comparisons of what is "nicer" or "more understandable"  
> or somesuch.
>
> In light of that, I'd rather discuss an area that actually needs  
> fixing, like the source code subsystem.

me too ;)
I would really like to understand/learn the problem of having a more  
parcel like system for squeak (ie having source and image (bytecode +  
object) chunk as a delivery system)



Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

stéphane ducasse-2
In reply to this post by Klaus D. Witzel
>
> O.K. will have a look at what can be stolen from Pavel's kernel  
> w.r.t. re-instantiating the as yet not terminated processes.

I think that this is important that we learned and indeed use what is  
good.

This discussion about method = is quite interesting (especially in  
presence of bytecode rewriting)
please continue....

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Klaus D. Witzel
Marcus,

can you confirm that the following collection is not empty in #7048

  (nil systemNavigation allMethodsSelect: [:cm |
        (cm methodClass methodDictionary includesIdentity: cm) not
    ]) asArray inspect

These methods have methodClass whose method dictionary doesn't include the  
method :-(

Did a #compileAll on the respective classes and now the collection is  
empty. Please put on the list for the next to come image. Thanks in  
advance.

/Klaus

On Wed, 26 Jul 2006 12:14:31 +0200, stéphane ducasse wrote:

>>
>> O.K. will have a look at what can be stolen from Pavel's kernel w.r.t.  
>> re-instantiating the as yet not terminated processes.
>
> I think that this is important that we learned and indeed use what is  
> good.
>
> This discussion about method = is quite interesting (especially in  
> presence of bytecode rewriting)
> please continue....
>
> Stef
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Marcus Denker

On 27.07.2006, at 18:48, Klaus D. Witzel wrote:

> Marcus,
>
> can you confirm that the following collection is not empty in #7048
>
>  (nil systemNavigation allMethodsSelect: [:cm |
> (cm methodClass methodDictionary includesIdentity: cm) not
>    ]) asArray inspect
>
> These methods have methodClass whose method dictionary doesn't  
> include the method :-(
>
> Did a #compileAll on the respective classes and now the collection  
> is empty. Please put on the list for the next to come image. Thanks  
> in advance.
Ok, I will recompile them.

    Marcus


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Klaus D. Witzel
Here's a shortcut for letting the COMPUTER do it:

        (nil systemNavigation allMethodsSelect: [:method |
            (method methodClass methodDictionary includesIdentity: method) not])
           do: [:cltr | cltr actualClass compileAll]

It presupposes the (already discussed) script from Andreas embraced by my  
nilifying (for throwing non-methodClass methods out of the image into  
nil-heaven):

        ProcessBrowser classPool associations do: [:each | each value: nil].
        WeakArray restartFinalizationProcess.
        MethodChangeRecord allInstancesDo: [:each | each noteNewMethod: nil].
        Delay startTimerInterruptWatcher.
        WorldState allInstancesDo: [:each | each convertAlarms; convertStepList].
        ExternalDropHandler initialize.
        ScrollBar initializeImagesCache.
        "SokobanMorph initFields."
        Vocabulary initialize.
        GradientFillStyle initPixelRampCache.
        Smalltalk garbageCollect.
        ProcessBrowser initialize.

/Klaus

On Fri, 28 Jul 2006 16:24:18 +0200, Marcus Denker wrote:

> On 27.07.2006, at 18:48, Klaus D. Witzel wrote:
>
>> Marcus,
>>
>> can you confirm that the following collection is not empty in #7048
>>
>>  (nil systemNavigation allMethodsSelect: [:cm |
>> (cm methodClass methodDictionary includesIdentity: cm) not
>>    ]) asArray inspect
>>
>> These methods have methodClass whose method dictionary doesn't
>> include the method :-(
>>
>> Did a #compileAll on the respective classes and now the collection
>> is empty. Please put on the list for the next to come image. Thanks
>> in advance.
>
> Ok, I will recompile them.
>
>     Marcus



Reply | Threaded
Open this post in threaded view
|

Re: Still about methodClass

Marcus Denker

On 29.07.2006, at 13:56, Klaus D. Witzel wrote:

> Here's a shortcut for letting the COMPUTER do it:
>
> (nil systemNavigation allMethodsSelect: [:method |
>    (method methodClass methodDictionary includesIdentity: method)  
> not])
>   do: [:cltr | cltr actualClass compileAll]
>
> It presupposes the (already discussed) script from Andreas embraced  
> by my nilifying (for throwing non-methodClass methods out of the  
> image into nil-heaven):
>
> ProcessBrowser classPool associations do: [:each | each value: nil].
> WeakArray restartFinalizationProcess.
> MethodChangeRecord allInstancesDo: [:each | each noteNewMethod: nil].
> Delay startTimerInterruptWatcher.
> WorldState allInstancesDo: [:each | each convertAlarms;  
> convertStepList].
> ExternalDropHandler initialize.
> ScrollBar initializeImagesCache.
> "SokobanMorph initFields."
> Vocabulary initialize.
> GradientFillStyle initPixelRampCache.
> Smalltalk garbageCollect.
> ProcessBrowser initialize.
Both are in the new 7049

     Marcus


smime.p7s (5K) Download Attachment
12