This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B.xs: rationalise all methods aliased to next()
authorDavid Mitchell <davem@iabyn.com>
Wed, 24 Oct 2012 20:53:38 +0000 (21:53 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 26 Oct 2012 15:51:55 +0000 (16:51 +0100)
commitbec746fe92e05b80645abd249ecd20efb0639cd6
tree810361bc3ba203afdf45a031ae2d8af5eb5962de
parent35633035766bc6dbd58414f7238f9b74430555d6
B.xs: rationalise all methods aliased to next()

The code for B::OP::next() actually implements all B::*OP::* methods
that work by directly returning a field at a known offset in the OP
structure. Methods that can't do direct access usually have their own
body, rather than sharing with next().

However, whether a method can do direct field access is often dependent on
threading and/or perl version; so the same method is sometimes implemented
by next(), and sometimes by one or more individual method bodies. This is
all very confusing.

This commit takes all methods that *may* be implemented within next(),
and makes them always implemented by next(), using a table of data that
describes each method's offset, or -1 if it needs special handling.

This makes it a lot easier to see what's going on, and will also make it
easier to add an overlay facility, which will be coming soon.

The following commit will consolidate the remaining B::*OP methods within
next().
ext/B/B.xs