This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make OP_METHOD* to be of new class METHOP
authorsyber <syber@crazypanda.ru>
Thu, 4 Sep 2014 18:08:59 +0000 (22:08 +0400)
committerDavid Mitchell <davem@iabyn.com>
Fri, 3 Oct 2014 12:40:54 +0000 (13:40 +0100)
commitb46e009d94293e069270690750f6c669c6d0ce22
treec335154dccea12b391db6aaf7cac73db22e08f43
parentdf968918245d10232f955ab0965da7f8d6297a29
Make OP_METHOD* to be of new class METHOP

Introduce a new opcode class, METHOP, which will hold class/method related
info needed at runtime to improve performance of class/object method
calls, then change OP_METHOD and OP_METHOD_NAMED from being UNOP/SVOP to
being METHOP.

Note that because OP_METHOD is a UNOP with an op_first, while
OP_METHOD_NAMED is an SVOP, the first field of the METHOP structure
is a union holding either op_first or op_sv. This was seen as less messy
than having to introduce two new op classes.

The new op class's character is '.'

Nothing has changed in functionality and/or performance by this commit.
It just introduces new structure which will be extended with extra
fields and used in later commits.

Added METHOP constructors:
- newMETHOP() for method ops with dynamic method names.
  The only optype for this op is OP_METHOD.
- newMETHOP_named() for method ops with constant method names.
  Optypes for this op are: OP_METHOD_NAMED (currently) and (later)
  OP_METHOD_SUPER, OP_METHOD_REDIR, OP_METHOD_NEXT, OP_METHOD_NEXTCAN,
  OP_METHOD_MAYBENEXT

(This commit includes fixups by davem)
23 files changed:
dump.c
embed.fnc
embed.h
ext/B/B.pm
ext/B/B.xs
ext/B/B/Concise.pm
ext/B/t/optree_specials.t
lib/B/Deparse.pm
lib/B/Op_private.pm
op.c
op.h
opcode.h
perl.c
perl.h
perly.act
perly.h
perly.tab
perly.y
pp_hot.c
proto.h
regen/op_private
regen/opcode.pl
regen/opcodes