[pypy-dev] [pypy-commit] pypy default: Hack to ensure that ll_arraycopy gets a proper effectinfo.write_descrs_arrays

Hakan Ardo hakan at debian.org
Tue Oct 4 00:00:22 CEST 2011


On Sat, Oct 1, 2011 at 1:27 PM, Maciej Fijalkowski <fijall at gmail.com> wrote:
> On Sat, Oct 1, 2011 at 4:38 AM, Hakan Ardo <hakan at debian.org> wrote:
>> On Fri, Sep 30, 2011 at 11:17 PM, Maciej Fijalkowski <fijall at gmail.com> wrote:
>>> On Fri, Sep 30, 2011 at 6:15 PM, Hakan Ardo <hakan at debian.org> wrote:
>>>> Hi,
>>>> is there a better way to fix this? The same kind of issue might arise elsewhere?
>>>
>>> Make sure that raw_memcopy has the correct effect on analyzer?
>>
>> What effect would that be? Setting extraeffect=EF_RANDOM_EFFECTS as it
>> can write anywhere? Can I then somehow give ll_arraycopy a more
>> restrictive effectinfo?
>
> Armin commited this on trunk: 78fddfb51114

Yes that improves the hack. However it still makes me concerned about
any other (potential future) usages of raw_memcopy. Wont they have the
same issue?

How about we set extraeffect=EF_RANDOM_EFFECTS in the effectinfo of
raw_memcopy and introduces a decorator that would allow us to lessen
the effect inhertited by a function calling it. Something like:

    def raw_memcopy_effect_in_arraycopy(source, dest, source_start,
dest_start, length):
        dest[dest_start] = source[source_start]

    @replace_inherited_effect_of(raw_memcopy,
with=raw_memcopy_effect_in_arraycopy)
    def ll_arraycopy(source, dest, source_start, dest_start, length):
        ...
        raw_memcopy(...)


-- 
Håkan Ardö


More information about the pypy-dev mailing list