diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-20 13:47:58 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-10-10 21:54:01 -0700 |
commit | 254da51f7d4c7ed280895a23be679ad865ed467d (patch) | |
tree | 111068417075df341f2ce5029524ab1a37188cb5 | |
parent | 6dbf0444b935d282757d46d944cd2e0eb84e986b (diff) | |
download | perl-254da51f7d4c7ed280895a23be679ad865ed467d.tar.gz |
Add refassign op type
-rw-r--r-- | ext/Opcode/Opcode.pm | 2 | ||||
-rw-r--r-- | lib/B/Op_private.pm | 1 | ||||
-rw-r--r-- | opcode.h | 8 | ||||
-rw-r--r-- | opnames.h | 3 | ||||
-rw-r--r-- | pp.c | 5 | ||||
-rw-r--r-- | pp_proto.h | 1 | ||||
-rw-r--r-- | regen/opcodes | 1 |
7 files changed, 19 insertions, 2 deletions
diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index 3da8d945cb..109ebb9931 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -402,7 +402,7 @@ These are a hotchpotch of opcodes still waiting to be considered once - rv2gv refgen srefgen ref + rv2gv refgen srefgen ref refassign bless -- could be used to change ownership of objects (reblessing) diff --git a/lib/B/Op_private.pm b/lib/B/Op_private.pm index 19e9561cce..93532217bb 100644 --- a/lib/B/Op_private.pm +++ b/lib/B/Op_private.pm @@ -427,6 +427,7 @@ $bits{readlink}{0} = $bf[0]; @{$bits{recv}}{3,2,1,0} = ($bf[3], $bf[3], $bf[3], $bf[3]); $bits{redo}{0} = $bf[0]; $bits{ref}{0} = $bf[0]; +@{$bits{refassign}}{1,0} = ($bf[1], $bf[1]); $bits{refgen}{0} = $bf[0]; $bits{regcmaybe}{0} = $bf[0]; $bits{regcomp}{0} = $bf[0]; @@ -527,6 +527,7 @@ EXTCONST char* const PL_op_name[] = { "introcv", "clonecv", "padrange", + "refassign", "freed", }; #endif @@ -914,6 +915,7 @@ EXTCONST char* const PL_op_desc[] = { "private subroutine", "private subroutine", "list of private variables", + "lvalue ref assignment", "freed op", }; #endif @@ -1315,6 +1317,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ Perl_pp_introcv, Perl_pp_clonecv, Perl_pp_padrange, + Perl_pp_refassign, } #endif #ifdef PERL_PPADDR_INITED @@ -1712,6 +1715,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */ Perl_ck_null, /* introcv */ Perl_ck_null, /* clonecv */ Perl_ck_null, /* padrange */ + Perl_ck_null, /* refassign */ } #endif #ifdef PERL_CHECK_INITED @@ -2103,6 +2107,7 @@ EXTCONST U32 PL_opargs[] = { 0x00000040, /* introcv */ 0x00000040, /* clonecv */ 0x00000040, /* padrange */ + 0x00000240, /* refassign */ }; #endif @@ -2710,6 +2715,7 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = { -1, /* introcv */ -1, /* clonecv */ 630, /* padrange */ + 632, /* refassign */ }; @@ -3068,6 +3074,7 @@ EXTCONST U16 PL_op_private_bitdefs[] = { /* runcv */ 0x00bd, /* fc */ 0x0003, /* padrange */ 0x25bc, 0x019b, + /* refassign */ 0x0067, }; @@ -3455,6 +3462,7 @@ EXTCONST U8 PL_op_private_valid[] = { /* INTROCV */ (0), /* CLONECV */ (0), /* PADRANGE */ (OPpPADRANGE_COUNTMASK|OPpLVAL_INTRO), + /* REFASSIGN */ (OPpARG2_MASK), }; @@ -393,10 +393,11 @@ typedef enum opcode { OP_INTROCV = 376, OP_CLONECV = 377, OP_PADRANGE = 378, + OP_REFASSIGN = 379, OP_max } opcode; -#define MAXO 379 +#define MAXO 380 #define OP_FREED MAXO /* the OP_IS_* macros are optimized to a simple range check because @@ -6160,6 +6160,11 @@ PP(pp_runcv) RETURN; } +PP(pp_refassign) +{ + DIE(aTHX_ "Unimplemented"); +} + /* * Local variables: diff --git a/pp_proto.h b/pp_proto.h index 73ff532b5c..611725cae1 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -192,6 +192,7 @@ PERL_CALLCONV OP *Perl_pp_readline(pTHX); PERL_CALLCONV OP *Perl_pp_readlink(pTHX); PERL_CALLCONV OP *Perl_pp_redo(pTHX); PERL_CALLCONV OP *Perl_pp_ref(pTHX); +PERL_CALLCONV OP *Perl_pp_refassign(pTHX); PERL_CALLCONV OP *Perl_pp_refgen(pTHX); PERL_CALLCONV OP *Perl_pp_regcomp(pTHX); PERL_CALLCONV OP *Perl_pp_regcreset(pTHX); diff --git a/regen/opcodes b/regen/opcodes index 313695b71c..6e332117d0 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -553,3 +553,4 @@ padcv private subroutine ck_null d0 introcv private subroutine ck_null d0 clonecv private subroutine ck_null d0 padrange list of private variables ck_null d0 +refassign lvalue ref assignment ck_null d2 |