This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add introcv op type
authorFather Chrysostomos <sprout@cpan.org>
Fri, 27 Jul 2012 01:21:02 +0000 (18:21 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 16 Sep 2012 05:45:03 +0000 (22:45 -0700)
This will be used for introducing ‘my’ subs on scope entry, by turning
off the stale flag.

ext/Opcode/Opcode.pm
opcode.h
opnames.h
pp.c
pp_proto.h
regen/opcode.pl
regen/opcodes

index ae1c409..8cc432f 100644 (file)
@@ -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
 
index 0d28351..be5bc03 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -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
 
index d8c9f64..b99fb8f 100644 (file)
--- a/opnames.h
+++ b/opnames.h
@@ -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
diff --git a/pp.c b/pp.c
index a14b62b..f8669c5 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -152,6 +152,11 @@ PP(pp_padcv)
     RETURN;
 }
 
+PP(pp_introcv)
+{
+    DIE(aTHX_ "panic: introcv");
+}
+
 /* Translations. */
 
 static const char S_no_symref_sv[] =
index 2cdaf3a..db19bfb 100644 (file)
@@ -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);
index 2ef64ec..7401562 100755 (executable)
@@ -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';
index 117566b..4bb41e5 100644 (file)
@@ -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