This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Speed up method calls like $o->Other::method() and $o->Other::SUPER::method().
authorsyber <syber@crazypanda.ru>
Mon, 1 Dec 2014 20:20:27 +0000 (23:20 +0300)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 3 Dec 2014 01:56:48 +0000 (17:56 -0800)
commit810bd8b704e337dfba3e46eaea33244c1b0afce3
tree1b45d1d145ccd5b7eecbb14ef57f69da2e5bdb3f
parent11f9ab1a291e36ad40cb66d0bd0aedce897c06c3
Speed up method calls like $o->Other::method() and $o->Other::SUPER::method().

It was done by adding new OP_METHOD_REDIR and OP_METHOD_REDIR_SUPER optypes.
Class name to redirect is saved into METHOP as a shared hash string.
Method name is changed (class name removed) an saved into op_meth_sv as
a shared string hash.

So there is no need now to scan for '::' and calculate class and method names
at runtime (in gv_fetchmethod_*) and searching cache HV without precomputed hash.

B::* modules are changed to support new op types.
method_redir is now printed by Concise like (for threaded perl)
$obj->AAA::meth
5        <.> method_redir[PACKAGE "AAA", PV "meth"] ->6
13 files changed:
dump.c
ext/B/B.xs
ext/B/B/Concise.pm
ext/Opcode/Opcode.pm
lib/B/Deparse.pm
lib/B/Op_private.pm
op.c
op.h
opcode.h
opnames.h
pp_hot.c
pp_proto.h
regen/opcodes