develooper Front page | perl.perl5.porters | Postings from June 2013

Raison d'être of op_ppaddr

Thread Next
From:
Steffen Mueller
Date:
June 24, 2013 17:17
Subject:
Raison d'être of op_ppaddr
Message ID:
51C87F0D.7000600@cpan.org
So this is going to make me look like a total fool. But I'm going to ask 
nonetheless. Possibly this is even covered by some documentation 
somewhere I didn't manage to be creative enough to discover.

What's the reason for having op_ppaddr in the OP itself? I can imagine 
two off the top of my head and I'm not sure on either of them that 
they're any good:

- It's an optimization to have the ptr to chase within the structure 
which is likely already in the L1 cache. If we had to look it up by OP 
type from PL_ppaddr, then we'd have to look at a distant bit of memory 
to find the function pointer.

- It's necessary because some nasty, nasty, nasty, horrible evilness is 
replacing the actual function pointers in OPs secretly for nefarious 
purposes such as nulling OPs without running afoul of assumptions in 
further bits of compilation. Wouldn't surprise me. I've had to resort to 
that in my prototype numeric JIT to hack around my poor understanding of 
the compile/optimize/linklist phase.

Is there another reason? Which one is it?

--Steffen

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About