diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-16 18:02:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-18 06:50:04 -0700 |
commit | deb8a388bf9e4429400eaf01ad745964d9d291d2 (patch) | |
tree | c87db314f335fc0d08b31031ac5ea892bedfa6c2 | |
parent | b4d59f86ab96ed072d044892c514c6e5a96f4534 (diff) | |
download | perl-deb8a388bf9e4429400eaf01ad745964d9d291d2.tar.gz |
Add coreargs op
&CORE::foo subs will use this operator for sorting out @_.
-rw-r--r-- | ext/Opcode/Opcode.pm | 4 | ||||
-rw-r--r-- | opcode.h | 5 | ||||
-rw-r--r-- | opnames.h | 3 | ||||
-rw-r--r-- | pp.c | 7 | ||||
-rw-r--r-- | pp_proto.h | 1 | ||||
-rw-r--r-- | regen/opcodes | 3 |
6 files changed, 20 insertions, 3 deletions
diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index b79256e161..deec0bfedf 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -6,7 +6,7 @@ use strict; our($VERSION, @ISA, @EXPORT_OK); -$VERSION = "1.19"; +$VERSION = "1.20"; use Carp; use Exporter (); @@ -335,7 +335,7 @@ invert_opset function. warn die lineseq nextstate scope enter leave - rv2cv anoncode prototype + rv2cv anoncode prototype coreargs entersub leavesub leavesublv return method method_named -- XXX loops via recursion? @@ -517,6 +517,7 @@ EXTCONST char* const PL_op_name[] = { "reach", "rkeys", "rvalues", + "coreargs", }; #endif @@ -895,6 +896,7 @@ EXTCONST char* const PL_op_desc[] = { "each on reference", "keys on reference", "values on reference", + "CORE:: subroutine", }; #endif @@ -1287,6 +1289,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ Perl_pp_reach, /* implemented by Perl_pp_rkeys */ Perl_pp_rkeys, Perl_pp_rvalues, /* implemented by Perl_pp_rkeys */ + Perl_pp_coreargs, } #endif #ifdef PERL_PPADDR_INITED @@ -1676,6 +1679,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */ Perl_ck_each, /* reach */ Perl_ck_each, /* rkeys */ Perl_ck_each, /* rvalues */ + Perl_ck_null, /* coreargs */ } #endif #ifdef PERL_CHECK_INITED @@ -2059,6 +2063,7 @@ EXTCONST U32 PL_opargs[] = { 0x00001b00, /* reach */ 0x00001b08, /* rkeys */ 0x00001b08, /* rvalues */ + 0x00000600, /* coreargs */ }; #endif @@ -385,10 +385,11 @@ typedef enum opcode { OP_REACH = 368, OP_RKEYS = 369, OP_RVALUES = 370, + OP_COREARGS = 371, OP_max } opcode; -#define MAXO 371 +#define MAXO 372 /* the OP_IS_(SOCKET|FILETEST) macros are optimized to a simple range check because all the member OPs are contiguous in opcode.pl @@ -5963,6 +5963,13 @@ PP(pp_boolkeys) RETURN; } +/* For sorting out arguments passed to a &CORE:: subroutine */ +PP(pp_coreargs) +{ + dSP; + RETURN; +} + /* * Local variables: * c-indentation-style: bsd diff --git a/pp_proto.h b/pp_proto.h index 2b01d6b0b6..5e19fc3120 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -42,6 +42,7 @@ PERL_CALLCONV OP *Perl_pp_concat(pTHX); PERL_CALLCONV OP *Perl_pp_cond_expr(pTHX); PERL_CALLCONV OP *Perl_pp_const(pTHX); PERL_CALLCONV OP *Perl_pp_continue(pTHX); +PERL_CALLCONV OP *Perl_pp_coreargs(pTHX); PERL_CALLCONV OP *Perl_pp_crypt(pTHX); PERL_CALLCONV OP *Perl_pp_dbmopen(pTHX); PERL_CALLCONV OP *Perl_pp_dbstate(pTHX); diff --git a/regen/opcodes b/regen/opcodes index ec9c5a76d7..c9c6984fbc 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -539,3 +539,6 @@ custom unknown custom operator ck_null 0 reach each on reference ck_each % S rkeys keys on reference ck_each t% S rvalues values on reference ck_each t% S + +# For CORE:: subs +coreargs CORE:: subroutine ck_null $ |