Sorry...I forgot a detail: the problem is that they were storing CompiledMethods in a Dictionary, keys. I guess in Pharo 1.0 it works perfect, but in 1.1 since keys return a Set (that was the changed?), you miss some methods ;) Just do InstructionClient methods size -> 27 InstructionClient methods asSet size -> 21 so...it is not fun :( solution ? ideas? help ? Thanks :) On Tue, May 18, 2010 at 3:35 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
Hi folks. I was debugging a problem with Moose and I realized that 2 different methods can have the same CompiledMethod. This was weird for me. I don't know if this is correct or not.
For example, evaluate:
(InstructionClient>>#methodReturnTop) = (InstructionClient>>#doDup) -> true
If you look at
CompiledMethod = aCompiledMethod "Answer whether the receiver implements the same code as aCompiledMethod."
| numLits | self == aCompiledMethod ifTrue: [ ^ true ]. self class = aCompiledMethod class ifFalse: [ ^ false ]. self size = aCompiledMethod size ifFalse: [ ^ false ]. self header = aCompiledMethod header ifFalse: [ ^ false ]. self initialPC to: self endPC do: [ :i | (self at: i) = (aCompiledMethod at: i) ifFalse: [ ^ false ] ]. (self sameLiteralsAs: aCompiledMethod) ifFalse: [ ^ false ]. self halt. ^ true
It is returning in the last ^ true.
What was weird for me is that (self sameLiteralsAs: aCompiledMethod) returns true also. But if I print both literals:
self literals -> {#methodReturnTop. (#InstructionClient->InstructionClient)}
aCompiledMethod literals -> {#doDup. (#InstructionClient->InstructionClient)}
So...for me they are differnt, but sameLiteralsAs: is returning true. Debugging that, it seems that in that method it is returning in the last ^ true.
So...any hints? is this the expected behavior ? or it is a bug ?
Thanks
Mariano