diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index baacf3c677ea9..a6d29e31e8bc0 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -1,4 +1,4 @@ -package Opcode 1.66; +package Opcode 1.67; use strict; @@ -309,6 +309,7 @@ invert_opset function. rv2hv helem hslice kvhslice each values keys exists delete aeach akeys avalues multideref argelem argdefelem argcheck + multiparam paramtest paramstore preinc i_preinc predec i_predec postinc i_postinc postdec i_postdec int hex oct abs pow multiply i_multiply diff --git a/lib/B/Op_private.pm b/lib/B/Op_private.pm index 255817c85fc11..fcf29433d594e 100644 --- a/lib/B/Op_private.pm +++ b/lib/B/Op_private.pm @@ -477,6 +477,7 @@ $bits{method_super}{0} = $bf[0]; @{$bits{msgsnd}}{3,2,1,0} = ($bf[5], $bf[5], $bf[5], $bf[5]); @{$bits{multiconcat}}{6,5,3,0} = ('OPpMULTICONCAT_APPEND', 'OPpMULTICONCAT_FAKE', 'OPpMULTICONCAT_STRINGIFY', $bf[0]); @{$bits{multideref}}{5,4,0} = ('OPpMULTIDEREF_DELETE', 'OPpMULTIDEREF_EXISTS', $bf[0]); +$bits{multiparam}{0} = $bf[0]; @{$bits{multiply}}{1,0} = ($bf[1], $bf[1]); @{$bits{ncmp}}{1,0} = ($bf[1], $bf[1]); @{$bits{ne}}{1,0} = ($bf[1], $bf[1]); @@ -495,6 +496,8 @@ $bits{padhv}{0} = 'OPpPADHV_ISKEYS'; @{$bits{padrange}}{6,5,4,3,2,1,0} = ($bf[6], $bf[6], $bf[6], $bf[6], $bf[6], $bf[6], $bf[6]); @{$bits{padsv}}{5,4} = ($bf[9], $bf[9]); $bits{padsv_store}{0} = $bf[0]; +$bits{paramstore}{0} = $bf[0]; +$bits{paramtest}{0} = $bf[0]; @{$bits{pipe_op}}{3,2,1,0} = ($bf[5], $bf[5], $bf[5], $bf[5]); $bits{pop}{0} = $bf[0]; $bits{pos}{0} = $bf[0]; diff --git a/opcode.h b/opcode.h index ab62fa16ccc63..78ca8a59bfbce 100644 --- a/opcode.h +++ b/opcode.h @@ -561,6 +561,9 @@ EXTCONST char* const PL_op_name[] INIT({ "methstart", "initfield", "classname", + "multiparam", + "paramtest", + "paramstore", "freed", }); @@ -980,6 +983,9 @@ EXTCONST char* const PL_op_desc[] INIT({ "method start", "initialise field", "class name", + "signature processing", + "signature argument value test", + "signature parameter default expression", "freed op", }); @@ -1404,6 +1410,9 @@ INIT({ Perl_pp_methstart, Perl_pp_initfield, Perl_pp_classname, + Perl_pp_multiparam, + Perl_pp_paramtest, + Perl_pp_paramstore, }); EXT Perl_check_t PL_check[] /* or perlvars.h */ @@ -1823,6 +1832,9 @@ INIT({ Perl_ck_null, /* methstart */ Perl_ck_null, /* initfield */ Perl_ck_classname, /* classname */ + Perl_ck_null, /* multiparam */ + Perl_ck_null, /* paramtest */ + Perl_ck_null, /* paramstore */ }); EXTCONST U32 PL_opargs[] INIT({ @@ -2241,6 +2253,9 @@ EXTCONST U32 PL_opargs[] INIT({ 0x00000f00, /* methstart */ 0x00000f00, /* initfield */ 0x00000008, /* classname */ + 0x00000f00, /* multiparam */ + 0x00000300, /* paramtest */ + 0x00000100, /* paramstore */ }); END_EXTERN_C @@ -2961,6 +2976,9 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = { 265, /* methstart */ 267, /* initfield */ -1, /* classname */ + 0, /* multiparam */ + 0, /* paramtest */ + 0, /* paramstore */ }; @@ -2979,7 +2997,7 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = { */ EXTCONST U16 PL_op_private_bitdefs[] = { - 0x0003, /* scalar, prototype, refgen, srefgen, readline, regcmaybe, regcreset, regcomp, substcont, chop, schop, defined, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, not, ucfirst, lcfirst, uc, lc, quotemeta, aeach, avalues, each, pop, shift, grepstart, mapstart, mapwhile, range, and, or, dor, andassign, orassign, dorassign, argcheck, 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, fc, anonconst, cmpchain_and, cmpchain_dup, entertrycatch, catch, is_bool, is_weak, weaken, unweaken, is_tainted */ + 0x0003, /* scalar, prototype, refgen, srefgen, readline, regcmaybe, regcreset, regcomp, substcont, chop, schop, defined, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, not, ucfirst, lcfirst, uc, lc, quotemeta, aeach, avalues, each, pop, shift, grepstart, mapstart, mapwhile, range, and, or, dor, andassign, orassign, dorassign, argcheck, 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, fc, anonconst, cmpchain_and, cmpchain_dup, entertrycatch, catch, is_bool, is_weak, weaken, unweaken, is_tainted, multiparam, paramtest, paramstore */ 0x3cfc, 0x5379, /* pushmark */ 0x00bd, /* wantarray, runcv */ 0x077e, 0x0554, 0x1b70, 0x542c, 0x4fc8, 0x4225, /* const */ @@ -3484,6 +3502,9 @@ EXTCONST U8 PL_op_private_valid[] = { /* METHSTART */ (OPpARG1_MASK|OPpINITFIELDS), /* INITFIELD */ (OPpARG1_MASK|OPpINITFIELD_AV|OPpINITFIELD_HV), /* CLASSNAME */ (0), + /* MULTIPARAM */ (OPpARG1_MASK), + /* PARAMTEST */ (OPpARG1_MASK), + /* PARAMSTORE */ (OPpARG1_MASK), }; diff --git a/opnames.h b/opnames.h index 4fb9f5d12d7d4..51c5a93c04893 100644 --- a/opnames.h +++ b/opnames.h @@ -429,6 +429,9 @@ typedef enum opcode { OP_METHSTART = 412, OP_INITFIELD = 413, OP_CLASSNAME = 414, + OP_MULTIPARAM = 415, + OP_PARAMTEST = 416, + OP_PARAMSTORE = 417, OP_max } opcode; @@ -439,7 +442,7 @@ An enum of all the legal Perl opcodes, defined in F =cut */ -#define MAXO 415 +#define MAXO 418 #define OP_FREED MAXO /* the OP_IS_* macros are optimized to a simple range check because diff --git a/pp.c b/pp.c index e26eaee51e5e3..a6fa27eb881fa 100644 --- a/pp.c +++ b/pp.c @@ -7801,6 +7801,21 @@ PP(pp_argcheck) return NORMAL; } +PP(pp_multiparam) +{ + croak("TODO pp_multiparam"); +} + +PP(pp_paramtest) +{ + croak("TODO pp_paramtest"); +} + +PP(pp_paramstore) +{ + croak("TODO pp_paramstore"); +} + PP_wrapped(pp_isa, 2, 0) { dSP; diff --git a/pp_proto.h b/pp_proto.h index 02754995f4f27..7041fc22411b0 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -176,6 +176,7 @@ PERL_CALLCONV PP(pp_mkdir) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_modulo) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_multiconcat) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_multideref) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_multiparam) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_multiply) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_nbit_and) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_nbit_or) __attribute__visibility__("hidden"); @@ -200,6 +201,8 @@ PERL_CALLCONV PP(pp_padhv) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_padrange) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_padsv) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_padsv_store) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_paramstore) __attribute__visibility__("hidden"); +PERL_CALLCONV PP(pp_paramtest) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_pipe_op) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_poptry) __attribute__visibility__("hidden"); PERL_CALLCONV PP(pp_pos) __attribute__visibility__("hidden"); diff --git a/regen/opcodes b/regen/opcodes index f93a7a0635b33..e69b97b896ff1 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -596,3 +596,7 @@ methstart method start ck_null + initfield initialise field ck_null + classname class name ck_classname 0t + +multiparam signature processing ck_null + +paramtest signature argument value test ck_null | +paramstore signature parameter default expression ck_null 1