summaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
authorsyber <syber@crazypanda.ru>2014-11-28 21:22:25 +0300
committerFather Chrysostomos <sprout@cpan.org>2014-11-28 18:10:58 -0800
commit7d6c333c75cb0519428c389de3894edcb394d3a0 (patch)
treed03a03a0aaa68b1a8348aea290600d0d7bee4e48 /opcode.h
parent5ec005187f9529697da2ef026ddf0a3758600148 (diff)
downloadperl-7d6c333c75cb0519428c389de3894edcb394d3a0.tar.gz
speedup for SUPER::method() calls.
In ck_method: Scan for '/::. If found SUPER::, create OP_METHOD_SUPER op with precomputed hash value for method name. In B::*, added support for method_super In pp_hot.c, pp_method_*: S_method_common removed, code related to getting stash is moved to S_opmethod_stash, other code is moved to pp_method_* functions. As a result, SUPER::func() calls speeded up by 50%.
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/opcode.h b/opcode.h
index 105dcbf32a..82b35199e3 100644
--- a/opcode.h
+++ b/opcode.h
@@ -350,6 +350,7 @@ EXTCONST char* const PL_op_name[] = {
"goto",
"exit",
"method_named",
+ "method_super",
"entergiven",
"leavegiven",
"enterwhen",
@@ -741,6 +742,7 @@ EXTCONST char* const PL_op_desc[] = {
"goto",
"exit",
"method with known name",
+ "super with known name",
"given()",
"leave given block",
"when()",
@@ -1146,6 +1148,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
Perl_pp_goto,
Perl_pp_exit,
Perl_pp_method_named,
+ Perl_pp_method_super,
Perl_pp_entergiven,
Perl_pp_leavegiven,
Perl_pp_enterwhen,
@@ -1547,6 +1550,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */
Perl_ck_null, /* goto */
Perl_ck_fun, /* exit */
Perl_ck_null, /* method_named */
+ Perl_ck_null, /* method_super */
Perl_ck_null, /* entergiven */
Perl_ck_null, /* leavegiven */
Perl_ck_null, /* enterwhen */
@@ -1942,6 +1946,7 @@ EXTCONST U32 PL_opargs[] = {
0x00000d04, /* goto */
0x00009b04, /* exit */
0x00000e40, /* method_named */
+ 0x00000e40, /* method_super */
0x00000340, /* entergiven */
0x00000100, /* leavegiven */
0x00000340, /* enterwhen */
@@ -2563,6 +2568,7 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = {
158, /* goto */
48, /* exit */
0, /* method_named */
+ 0, /* method_super */
0, /* entergiven */
0, /* leavegiven */
0, /* enterwhen */
@@ -2762,7 +2768,7 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = {
*/
EXTCONST U16 PL_op_private_bitdefs[] = {
- 0x0003, /* scalar, prototype, refgen, srefgen, ref, readline, regcmaybe, regcreset, regcomp, chop, schop, defined, undef, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, negate, i_negate, not, complement, ucfirst, lcfirst, uc, lc, quotemeta, aeach, akeys, avalues, each, values, pop, shift, range, and, or, dor, andassign, orassign, dorassign, method, method_named, entergiven, leavegiven, enterwhen, leavewhen, untie, tied, dbmclose, getsockname, getpeername, lstat, stat, readlink, readdir, telldir, rewinddir, closedir, localtime, alarm, require, dofile, entertry, ghbyname, gnbyname, gpbyname, shostent, snetent, sprotoent, sservent, gpwnam, gpwuid, ggrnam, ggrgid, lock, once, reach, rvalues, fc */
+ 0x0003, /* scalar, prototype, refgen, srefgen, ref, readline, regcmaybe, regcreset, regcomp, chop, schop, defined, undef, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, negate, i_negate, not, complement, ucfirst, lcfirst, uc, lc, quotemeta, aeach, akeys, avalues, each, values, pop, shift, range, and, or, dor, andassign, orassign, dorassign, method, method_named, method_super, entergiven, leavegiven, enterwhen, leavewhen, untie, tied, dbmclose, getsockname, getpeername, lstat, stat, readlink, readdir, telldir, rewinddir, closedir, localtime, alarm, require, dofile, entertry, ghbyname, gnbyname, gpbyname, shostent, snetent, sprotoent, sservent, gpwnam, gpwuid, ggrnam, ggrgid, lock, once, reach, rvalues, fc */
0x281c, 0x3a19, /* pushmark */
0x00bd, /* wantarray, runcv */
0x03b8, 0x1490, 0x3acc, 0x3588, 0x2be5, /* const */
@@ -3036,6 +3042,7 @@ EXTCONST U8 PL_op_private_valid[] = {
/* GOTO */ (OPpARG1_MASK|OPpPV_IS_UTF8),
/* EXIT */ (OPpARG4_MASK),
/* METHOD_NAMED */ (OPpARG1_MASK),
+ /* METHOD_SUPER */ (OPpARG1_MASK),
/* ENTERGIVEN */ (OPpARG1_MASK),
/* LEAVEGIVEN */ (OPpARG1_MASK),
/* ENTERWHEN */ (OPpARG1_MASK),