[pypy-dev] [pypy-svn] r77589 - pypy/trunk/pypy/jit/metainterp

Maciej Fijalkowski fijall at gmail.com
Tue Oct 5 08:42:54 CEST 2010


On Mon, Oct 4, 2010 at 11:56 PM, Antonio Cuni <anto.cuni at gmail.com> wrote:
> On 04/10/10 23:32, fijal at codespeak.net wrote:
>
>>   def transform(op):
>>       from pypy.jit.metainterp.history import AbstractDescr
>> -    # Rename CALL_PURE to CALL.
>> +    # Rename CALL_PURE and CALL_INVARIANT to CALL.
>>       # Simplify the VIRTUAL_REF_* so that they don't show up in the backend.
>> -    if op.getopnum() == rop.CALL_PURE:
>> +    if (op.getopnum() == rop.CALL_PURE or
>> +        op.getopnum() == rop.CALL_LOOPINVARIANT):
>>           op = ResOperation(rop.CALL, op.getarglist()[1:], op.result,
>>                             op.getdescr())
>>       elif op.getopnum() == rop.VIRTUAL_REF:
>
> Hi,
> I just wanted to tell that since the resoperation-refactoring, there is now a
> nice "copy_and_change" method to be used exactly for the case where you want
> to replace an operation with a "similar" one.
>
> So, the code above should be written like:
>
>    op = op.copy_and_change(rop.CALL, args=op.getarglist()[1:])

ah, great! :)

>
> ciao,
> Anto
> _______________________________________________
> pypy-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-dev
>



More information about the Pypy-dev mailing list