Re: [pypy-dev] [pypy-commit] pypy default: investigate mark_opaque_ptr

2014-10-14 Thread Hakan Ardo
Hi again, for more details, look at 77dce024e344. It takes the original approach of not touching operations using opaque pointers at all into one that allows getfield_gc(p,...) with p opaque in the short_preamble in some specific cases. On Tue, Oct 14, 2014 at 9:55 AM, Hakan Ardo wrote: > On Tue

Re: [pypy-dev] [pypy-commit] pypy default: investigate mark_opaque_ptr

2014-10-14 Thread Hakan Ardo
On Tue, Oct 14, 2014 at 9:26 AM, Armin Rigo wrote: > > I'm not sure: the logic in optimizeopt/heap.py seems to be "if it's an > opaque pointer, and if we don't know its class, then don't move it". > According to this logic, operations on RPython instances (like > GUARD_CLASS) can still be moved to

Re: [pypy-dev] [pypy-commit] pypy default: investigate mark_opaque_ptr

2014-10-14 Thread Armin Rigo
Hi Hakan, On 13 October 2014 18:59, Hakan Ardo wrote: > Are we certain opaque pointers always refer to GC-objects? Yes. > Right, but mark_opaque_ptr prevents this case as well by not moving > operations using opaque pointers into the short preamble. So I guess > we are currently fine? I'm not

Re: [pypy-dev] [pypy-commit] pypy default: investigate mark_opaque_ptr

2014-10-13 Thread Hakan Ardo
On Mon, Oct 13, 2014 at 6:09 PM, Armin Rigo wrote: > > I think it should work. I'm sure your right :) > What I have in mind for GUARD_GCTYPE would be > to check the GC header of the object; all GC pointers have one, with > our own GCs --- even GcArrays. So GUARD_GCTYPE would check that the > ob

Re: [pypy-dev] [pypy-commit] pypy default: investigate mark_opaque_ptr

2014-10-13 Thread Armin Rigo
Hi Hakan, On 13 October 2014 13:10, Hakan Ardo wrote: > I think the problematic case is actually when mixing with arrays. > There will already be a guard_class protecting the getfiled in the > short preamble, but it crashes when operating on an array. Also, there > is no guard_arraytype. So mixin

Re: [pypy-dev] [pypy-commit] pypy default: investigate mark_opaque_ptr

2014-10-13 Thread Hakan Ardo
On Mon, Oct 13, 2014 at 12:24 PM, Armin Rigo wrote: >> >> Yes as far as I can remember. You have ofcourse the exact same issue >> with getarrayitem_* and friends... > > Ah, indeed. > > I'm thinking about a more involved fix, prompted by > https://bitbucket.org/pypy/pypy/issue/1886 . Would it work

Re: [pypy-dev] [pypy-commit] pypy default: investigate mark_opaque_ptr

2014-10-13 Thread Armin Rigo
Hi Hakan, On 13 October 2014 11:52, Hakan Ardo wrote: > On Mon, Oct 13, 2014 at 11:45 AM, Armin Rigo wrote: >> Hi Hakan, >> >> On 13 October 2014 10:11, Hakan Ardo wrote: >>> mark_opaque_ptr is used by unrolling to prevent moving getfield_gc(p1) >>> into the short preamble is p1 if opaque. This