diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-07-26 18:21:02 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-09-15 22:45:03 -0700 |
commit | ecf9c8b78fdc5245e639ddb2830e8e43cda480b9 (patch) | |
tree | d17ac0ac0b8d120a1e27b229acdd06111950fe1d | |
parent | 10342479afca0484c66269733fcc2f4a1fbabbb7 (diff) | |
download | perl-ecf9c8b78fdc5245e639ddb2830e8e43cda480b9.tar.gz |
Add introcv op type
This will be used for introducing ‘my’ subs on scope entry, by turning
off the stale flag.
-rw-r--r-- | ext/Opcode/Opcode.pm | 2 | ||||
-rw-r--r-- | opcode.h | 5 | ||||
-rw-r--r-- | opnames.h | 3 | ||||
-rw-r--r-- | pp.c | 5 | ||||
-rw-r--r-- | pp_proto.h | 1 | ||||
-rwxr-xr-x | regen/opcode.pl | 2 | ||||
-rw-r--r-- | regen/opcodes | 1 |
7 files changed, 16 insertions, 3 deletions
diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index ae1c4094f5..8cc432f9b3 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -397,7 +397,7 @@ These are a hotchpotch of opcodes still waiting to be considered gvsv gv gelem - padsv padav padhv padcv padany + padsv padav padhv padcv padany introcv once @@ -522,6 +522,7 @@ EXTCONST char* const PL_op_name[] = { "runcv", "fc", "padcv", + "introcv", "freed", }; #endif @@ -904,6 +905,7 @@ EXTCONST char* const PL_op_desc[] = { "__SUB__", "fc", "private subroutine", + "private subroutine", "freed op", }; #endif @@ -1300,6 +1302,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ Perl_pp_runcv, Perl_pp_fc, Perl_pp_padcv, + Perl_pp_introcv, } #endif #ifdef PERL_PPADDR_INITED @@ -1692,6 +1695,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */ Perl_ck_null, /* runcv */ Perl_ck_fun, /* fc */ Perl_ck_null, /* padcv */ + Perl_ck_null, /* introcv */ } #endif #ifdef PERL_CHECK_INITED @@ -2078,6 +2082,7 @@ EXTCONST U32 PL_opargs[] = { 0x00000004, /* runcv */ 0x00009b8e, /* fc */ 0x00000040, /* padcv */ + 0x00000040, /* introcv */ }; #endif @@ -388,10 +388,11 @@ typedef enum opcode { OP_RUNCV = 371, OP_FC = 372, OP_PADCV = 373, + OP_INTROCV = 374, OP_max } opcode; -#define MAXO 374 +#define MAXO 375 #define OP_FREED MAXO /* the OP_IS_* macros are optimized to a simple range check because @@ -152,6 +152,11 @@ PP(pp_padcv) RETURN; } +PP(pp_introcv) +{ + DIE(aTHX_ "panic: introcv"); +} + /* Translations. */ static const char S_no_symref_sv[] = diff --git a/pp_proto.h b/pp_proto.h index 2cdaf3ae32..db19bfbed2 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -118,6 +118,7 @@ PERL_CALLCONV OP *Perl_pp_i_negate(pTHX); PERL_CALLCONV OP *Perl_pp_i_subtract(pTHX); PERL_CALLCONV OP *Perl_pp_index(pTHX); PERL_CALLCONV OP *Perl_pp_int(pTHX); +PERL_CALLCONV OP *Perl_pp_introcv(pTHX); PERL_CALLCONV OP *Perl_pp_ioctl(pTHX); PERL_CALLCONV OP *Perl_pp_iter(pTHX); PERL_CALLCONV OP *Perl_pp_join(pTHX); diff --git a/regen/opcode.pl b/regen/opcode.pl index 2ef64ec59d..7401562dd5 100755 --- a/regen/opcode.pl +++ b/regen/opcode.pl @@ -44,7 +44,7 @@ while (<OPS>) { $args = '' unless defined $args; warn qq[Description "$desc" duplicates $seen{$desc}\n] - if $seen{$desc} and $key ne "transr"; + if $seen{$desc} and $key !~ "transr|introcv"; die qq[Opcode "$key" duplicates $seen{$key}\n] if $seen{$key}; die qq[Opcode "freed" is reserved for the slab allocator\n] if $key eq 'freed'; diff --git a/regen/opcodes b/regen/opcodes index 117566bad2..4bb41e504c 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -548,3 +548,4 @@ runcv __SUB__ ck_null s0 fc fc ck_fun fstu% S? padcv private subroutine ck_null d0 +introcv private subroutine ck_null d0 |