[Pharo-project] Problem with CompiledMethodTrailer

Mariano Martinez Peck marianopeck at gmail.com
Tue May 10 10:46:55 CEST 2011

> > So I would like to still know:
> > 1) while those fucking CMs are not GCed
> > 2) how they can be generated.
> >
> > I have spent the whole day and I couldn't :(    I am more interested in
> 1)
> > Notice that I didn't do anything weird. I just took the default Pharo1.3
> > image.
> >
> you could take any method and just do
> #copyWithTrailerBytes:
> with any trailer you would like to test.
Thanks. I don't understand how I can create a trailer with tempNames.
Actually, I don't understand what string to pass as tempNames. In your
#testEmbeddingTempNames  you do:

code := 'testEmbeddingSourceCode

    | trailer newTrailer code |

    trailer := CompiledMethodTrailer new.

    trailer sourceCode: code.
    newTrailer := trailer testEncoding.

    self assert: (newTrailer sourceCode = code).'.

trailer tempNames: code.

But I am not sure if that's correct. What does it means? that as temp names
I send the full source code?  I tried and doesn't work.
And then, I read the following method which says something about writing the
tempNames with a particular way:


"Answer the temp names for the current method node in a form that captures
     temp structure.  The temps at each method and block scope level occur
     space-separated, with any indirect temps enclosed in parentheses.  Each
     level is enclosed in square brackets.  e.g.
        'method level temps (indirect temp)[block args and temps
     This representation can be reconstituted into a blockExtentsToTempsMap
     by a CompiledMethod that has been copied with the

You can also look at CompiledMethodTrailerTest for examples (see
> #testEncoding).
> As for finding pointers.. have you tried to use pointer finder? :)
> (it means i can't help with it more than you already know).

Yeah, I tried it. But maybe I am not seeing something :(
If you want to try it by yourself, just take any Pharo1.3 image like:

And explore any of the pointers of
((CompiledMethod allInstances select:  [:each | each trailer kind =
#VarLengthSourcePointer] ) )

thanks for the effort


> > Thanks Igor for your help.
> >
> >
> > --
> > Mariano
> > http://marianopeck.wordpress.com
> >
> >
> --
> Best regards,
> Igor Stasenko AKA sig.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110510/9153fb6a/attachment.htm>

More information about the Pharo-project mailing list