[Pharo-project] Problem with CompiledMethodTrailer

Igor Stasenko siguctua at gmail.com
Mon May 9 10:04:46 CEST 2011


On 9 May 2011 09:36, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
>
>
> On Mon, May 9, 2011 at 6:14 AM, Igor Stasenko <siguctua at gmail.com> wrote:
>>
>> On 9 May 2011 00:52, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
>> > Hi guys, Maybe it is too late and I am not seeing something obvious...so
>> > another look is really appreciated. If I do:
>> >
>> > (CompiledMethod allInstances select:  [:each | each trailer kind =
>> > #VarLengthSourcePointer] ) first
>> > ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)")
>> >
>> > But then:
>> >
>> > (CodeLoader class >> #initialize) trailer kind
>> > ----> #SourcePointer
>> >
>> > WHYYY??  why it is answering #SourcePointer instead of
>> > #VarLengthSourcePointer  ??
>> >
>> > grrr how can that be possible???  It happens the same to each of the
>> > CompiledMethods I select as #VarLengthSourcePointer.  When I then ask
>> > the
>> > #kind  they always answer #SourcePointer  instead of
>> > #VarLengthSourcePointer
>> >
>> is it same compiled methods?
>> Because it is absolutely normal if they using different source pointer.
>>
>
> I didn't understand your question. Yes, it is exactly the same
> CompiledMethod.
> Look, if I do:
>
> (CompiledMethod allInstances select:  [:each | each trailer kind =
> #VarLengthSourcePointer] ) first
>
> I get
> ---> (CodeLoader class>>#initialize "a CompiledMethod(311951360)")
>
> So...it means that such CompiledMethod answers #VarLengthSourcePointer when
> send "trailer kind". Ok?
>
> But immediatly after, if I ask the trailer kind to the SAME compiled method:
>
> (CodeLoader class >> #initialize) trailer kind
>
> I get
> ----> #SourcePointer
>
> WHYYY??  why it is answering #SourcePointer instead of
> #VarLengthSourcePointer  ??
>
Its not the same. Look:

(CompiledMethod allInstances select:  [:each | each trailer kind =
#VarLengthSourcePointer] ) first
==  (CodeLoader class>>#initialize )

answers false.

Which means that there are two instances of CompiledMethod. One is
installed into a class,
and another hangs somewhere..

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Pharo-project mailing list