Hi Stef. From what I can see, the category can be nil only when CompiledMethods are created for DoIts but not for regular CompiledMethods.
Even those which are under 'as yet unclassified'� answer that and not nil.

(CompiledMethod allInstances select: [ :each | (each category isNil and:
��� �[(each selector beginsWith: #DoIt) not]) ])� size

answers 0 in my image.

(CompiledMethod allInstances select: [ :each | each category isNil ] thenCollect: [:each | each selector]) asSet
-->>� a Set(#DoIt #DoItIn:)

So...only those guys answers nil. Is that important?�� If so, we already have the message:

CompiledMethod >> isSelfEvaluating
��� ^self methodClass notNil and: [(#(#DoIt #DoItIn: nil) includes: self selector) not]

that answers false for those do its. Hence, we could patch� to something like this:

CompiledMethod >> category
��� self isSelfEvaluating ifFalse: [^ 'evaluating'].
��� ^self methodClass organization categoryOfElement:self selector


There is another solution:� the CM to answers its category delegates to "^self methodClass organization categoryOfElement:self selector"�� for do-its, the methodClass is always "UndefinedObject"

So.....I can create a category called "evaluation" in UndefinedObject and put� these two new methods:

DoIt
��� "When execution code from a workspace or similar places the Compiler creates a dummy CompiledMethod whose methodClass is UndefinedObject. When such CompiledMethods are ask its category, it answers nil, since the selector is search in the organization of the methodClass, which in this case is UndefinedObject.� Hence, implementing this mehtod here will make such CompiledMethods to answer the category where this method is. "

DoItIn: nonImportant
��� "When execution code from a workspace or similar places the Compiler creates a dummy CompiledMethod whose methodClass is UndefinedObject. When such CompiledMethods are ask its category, it answers nil, since the selector is search in the organization of the methodClass, which in this case is UndefinedObject.� Hence, implementing this mehtod here will make such CompiledMethods to answer the category where this method is. "

So....now:

(CompiledMethod allInstances select: [ :each | each isSelfEvaluating not ] thenCollect: [:each| each category ]) asSet
�--->a Set(#evaluation)�


I am not sure which of the both solution is the best nor the impact of them,

Cheers

Mariano


On Mon, May 9, 2011 at 11:35 AM, St�phane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi guys

With cyrille we experience sometimes CompiledMethod with nil category and this can break hard some problem.
We were thinking but not sure that it would be good to make sure that nil is not returned but 'as yet unclassified'
What do you think?
Do you have any idea of potential problem?

Stef



--
Mariano
http://marianopeck.wordpress.com