CompiledMethodTrailer with a different CompiledMethod class

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

CompiledMethodTrailer with a different CompiledMethod class

hernanmd
Hello

Just to make a little note. I'm adapting the lightweight classes
package to work with CompilerMethodTrailer. In this method

CompiledMethodTrailer>>createMethod: numberOfBytesForAllButTrailer
header: headerWord
        | meth |
        encodedData ifNil: [ self encode ].
        meth := CompiledMethod newMethod: numberOfBytesForAllButTrailer +
size header: headerWord.
        ...

I need to answer a different kind of CompiledMethod, it would be nice
if my own CompiledMethod class could be specified in some way to make
the CompiledMethodTrailer more flexible.
Cheers,

Hernán

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethodTrailer with a different CompiledMethod class

Igor Stasenko
On 24 May 2010 10:31, Hernán Morales Durand <[hidden email]> wrote:

> Hello
>
> Just to make a little note. I'm adapting the lightweight classes
> package to work with CompilerMethodTrailer. In this method
>
> CompiledMethodTrailer>>createMethod: numberOfBytesForAllButTrailer
> header: headerWord
>        | meth |
>        encodedData ifNil: [ self encode ].
>        meth := CompiledMethod newMethod: numberOfBytesForAllButTrailer +
> size header: headerWord.
>        ...
>
> I need to answer a different kind of CompiledMethod, it would be nice
> if my own CompiledMethod class could be specified in some way to make
> the CompiledMethodTrailer more flexible.

Yes, you could add a class parameter, so method will take 3

createMethod: numberOfBytesForAllButTrailer header: headerWord class:
aMethodClass

> Cheers,
>
> Hernán
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: CompiledMethodTrailer with a different CompiledMethod class

Stéphane Ducasse
and send us the fix for inclusion :)

On May 24, 2010, at 10:54 AM, Igor Stasenko wrote:

> On 24 May 2010 10:31, Hernán Morales Durand <[hidden email]> wrote:
>> Hello
>>
>> Just to make a little note. I'm adapting the lightweight classes
>> package to work with CompilerMethodTrailer. In this method
>>
>> CompiledMethodTrailer>>createMethod: numberOfBytesForAllButTrailer
>> header: headerWord
>>        | meth |
>>        encodedData ifNil: [ self encode ].
>>        meth := CompiledMethod newMethod: numberOfBytesForAllButTrailer +
>> size header: headerWord.
>>        ...
>>
>> I need to answer a different kind of CompiledMethod, it would be nice
>> if my own CompiledMethod class could be specified in some way to make
>> the CompiledMethodTrailer more flexible.
>
> Yes, you could add a class parameter, so method will take 3
>
> createMethod: numberOfBytesForAllButTrailer header: headerWord class:
> aMethodClass
>
>> Cheers,
>>
>> Hernán
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

[ENH] CompiledMethodTrailer with a different CompiledMethod class

Igor Stasenko
Hello,
i added a simple enhancement to make CompilerMethodTrailer to be more
friendly with
CompiledMethod subclasses.
It provides an additional method #createMethod:header:methodClass:
which allows to create a compiled method with other class, than a
CompiledMethod.

Installing it requires 2 separate phases:
phase1  - adds #createMethod:header:methodClass:  method
phase2 - puts this method in use.

if you merge these changesets, you'd will run into a problem, because
filein/fileout utility does not honors the order of changes, how they
should be applied.


On 24 May 2010 13:27, Stéphane Ducasse <[hidden email]> wrote:

> and send us the fix for inclusion :)
>
> On May 24, 2010, at 10:54 AM, Igor Stasenko wrote:
>
>> On 24 May 2010 10:31, Hernán Morales Durand <[hidden email]> wrote:
>>> Hello
>>>
>>> Just to make a little note. I'm adapting the lightweight classes
>>> package to work with CompilerMethodTrailer. In this method
>>>
>>> CompiledMethodTrailer>>createMethod: numberOfBytesForAllButTrailer
>>> header: headerWord
>>>        | meth |
>>>        encodedData ifNil: [ self encode ].
>>>        meth := CompiledMethod newMethod: numberOfBytesForAllButTrailer +
>>> size header: headerWord.
>>>        ...
>>>
>>> I need to answer a different kind of CompiledMethod, it would be nice
>>> if my own CompiledMethod class could be specified in some way to make
>>> the CompiledMethodTrailer more flexible.
>>
>> Yes, you could add a class parameter, so method will take 3
>>
>> createMethod: numberOfBytesForAllButTrailer header: headerWord class:
>> aMethodClass
>>
>>> Cheers,
>>>
>>> Hernán
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

CMT-methodClass-phase1.1.cs (762 bytes) Download Attachment
CMT-methodclass-phase2.1.cs (4K) Download Attachment