5 # Get function prototypes
6 require 'regen_lib.pl';
9 my $opcode_new = 'opcode.h-new';
10 my $opname_new = 'opnames.h-new';
11 open(OC, ">$opcode_new") || die "Can't create $opcode_new: $!\n";
13 open(ON, ">$opname_new") || die "Can't create $opname_new: $!\n";
20 my (@ops, %desc, %check, %ckname, %flags, %args, %opnum);
26 my ($key, $desc, $check, $flags, $args) = split(/\t+/, $_, 5);
27 $args = '' unless defined $args;
29 warn qq[Description "$desc" duplicates $seen{$desc}\n] if $seen{$desc};
30 die qq[Opcode "$key" duplicates $seen{$key}\n] if $seen{$key};
31 $seen{$desc} = qq[description of opcode "$key"];
32 $seen{$key} = qq[opcode "$key"];
37 $check{$key} = $check;
39 $flags{$key} = $flags;
47 # Format is "this function" => "does these op names"
49 Perl_do_kv => [qw( keys values )],
50 Perl_unimplemented_op => [qw(padany mapstart custom)],
51 # All the ops with a body of { return NORMAL; }
52 Perl_pp_null => [qw(scalar regcmaybe lineseq scope)],
54 Perl_pp_goto => ['dump'],
55 Perl_pp_require => ['dofile'],
56 Perl_pp_untie => ['dbmclose'],
57 Perl_pp_sysread => [qw(read recv)],
58 Perl_pp_sysseek => ['seek'],
59 Perl_pp_ioctl => ['fcntl'],
60 Perl_pp_ssockopt => ['gsockopt'],
61 Perl_pp_getpeername => ['getsockname'],
62 Perl_pp_stat => ['lstat'],
63 Perl_pp_ftrowned => [qw(fteowned ftzero ftsock ftchr ftblk
64 ftfile ftdir ftpipe ftsuid ftsgid
66 Perl_pp_fttext => ['ftbinary'],
67 Perl_pp_gmtime => ['localtime'],
68 Perl_pp_semget => [qw(shmget msgget)],
69 Perl_pp_semctl => [qw(shmctl msgctl)],
70 Perl_pp_ghostent => [qw(ghbyname ghbyaddr)],
71 Perl_pp_gnetent => [qw(gnbyname gnbyaddr)],
72 Perl_pp_gprotoent => [qw(gpbyname gpbynumber)],
73 Perl_pp_gservent => [qw(gsbyname gsbyport)],
74 Perl_pp_gpwent => [qw(gpwnam gpwuid)],
75 Perl_pp_ggrent => [qw(ggrnam ggrgid)],
76 Perl_pp_ftis => [qw(ftsize ftmtime ftatime ftctime)],
77 Perl_pp_chown => [qw(unlink chmod utime kill)],
78 Perl_pp_link => ['symlink'],
79 Perl_pp_ftrread => [qw(ftrwrite ftrexec fteread ftewrite
81 Perl_pp_shmwrite => [qw(shmread msgsnd msgrcv semop)],
82 Perl_pp_send => ['syswrite'],
83 Perl_pp_defined => [qw(dor dorassign)],
84 Perl_pp_and => ['andassign'],
85 Perl_pp_or => ['orassign'],
86 Perl_pp_ucfirst => ['lcfirst'],
87 Perl_pp_sle => [qw(slt sgt sge)],
88 Perl_pp_print => ['say'],
89 Perl_pp_index => ['rindex'],
90 Perl_pp_oct => ['hex'],
91 Perl_pp_shift => ['pop'],
92 Perl_pp_sin => [qw(cos exp log sqrt)],
93 Perl_pp_bit_or => ['bit_xor'],
94 Perl_pp_rv2av => ['rv2hv'],
95 Perl_pp_akeys => ['avalues'],
98 while (my ($func, $names) = splice @raw_alias, 0, 2) {
99 $alias{$_} = $func for @$names;
105 /* -*- buffer-read-only: t -*-
109 * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
110 * 2001, 2002, 2003, 2004, 2005, 2006, 2007 by Larry Wall and others
112 * You may distribute under the terms of either the GNU General Public
113 * License or the Artistic License, as specified in the README file.
115 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
116 * This file is built by opcode.pl from its data. Any changes made here
120 #ifndef PERL_GLOBAL_STRUCT_INIT
122 #define Perl_pp_i_preinc Perl_pp_preinc
123 #define Perl_pp_i_predec Perl_pp_predec
124 #define Perl_pp_i_postinc Perl_pp_postinc
125 #define Perl_pp_i_postdec Perl_pp_postdec
127 PERL_PPDEF(Perl_unimplemented_op)
132 /* -*- buffer-read-only: t -*-
136 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
137 * 2007 by Larry Wall and others
139 * You may distribute under the terms of either the GNU General Public
140 * License or the Artistic License, as specified in the README file.
143 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
144 * This file is built by opcode.pl from its data. Any changes made here
148 typedef enum opcode {
153 # print ON "\t", &tab(3,"OP_\U$_,"), "/* ", $i++, " */\n";
154 print ON "\t", &tab(3,"OP_\U$_"), " = ", $i++, ",\n";
156 print ON "\t", &tab(3,"OP_max"), "\n";
157 print ON "} opcode;\n";
158 print ON "\n#define MAXO ", scalar @ops, "\n";
159 print ON "#define OP_phoney_INPUT_ONLY -1\n";
160 print ON "#define OP_phoney_OUTPUT_ONLY -2\n\n";
162 # Emit op names and descriptions.
167 #define OP_NAME(o) ((o)->op_type == OP_CUSTOM ? custom_op_name(o) : \\
168 PL_op_name[(o)->op_type])
169 #define OP_DESC(o) ((o)->op_type == OP_CUSTOM ? custom_op_desc(o) : \\
170 PL_op_desc[(o)->op_type])
173 EXTCONST char* const PL_op_name[];
175 EXTCONST char* const PL_op_name[] = {
190 EXTCONST char* const PL_op_desc[];
192 EXTCONST char* const PL_op_desc[] = {
196 my($safe_desc) = $desc{$_};
198 # Have to escape double quotes and escape characters.
199 $safe_desc =~ s/(^|[^\\])([\\"])/$1\\$2/g;
201 print qq(\t"$safe_desc",\n);
210 #endif /* !PERL_GLOBAL_STRUCT_INIT */
213 # Emit function declarations.
215 #for (sort keys %ckname) {
216 # print "OP *\t", &tab(3,$_),"(pTHX_ OP* o);\n";
222 # print "OP *\t", &tab(3, "pp_$_"), "(pTHX);\n";
225 # Emit ppcode switch array.
231 #ifdef PERL_GLOBAL_STRUCT_INIT
232 # define PERL_PPADDR_INITED
233 static const Perl_ppaddr_t Gppaddr[]
235 # ifndef PERL_GLOBAL_STRUCT
236 # define PERL_PPADDR_INITED
237 EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
239 #endif /* PERL_GLOBAL_STRUCT */
240 #if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT)
241 # define PERL_PPADDR_INITED
246 if (my $name = $alias{$_}) {
247 print "\tMEMBER_TO_FPTR($name),\t/* Perl_pp_$_ */\n";
250 print "\tMEMBER_TO_FPTR(Perl_pp_$_),\n";
257 #ifdef PERL_PPADDR_INITED
263 # Emit check routines.
266 #ifdef PERL_GLOBAL_STRUCT_INIT
267 # define PERL_CHECK_INITED
268 static const Perl_check_t Gcheck[]
270 # ifndef PERL_GLOBAL_STRUCT
271 # define PERL_CHECK_INITED
272 EXT Perl_check_t PL_check[] /* or perlvars.h */
275 #if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT)
276 # define PERL_CHECK_INITED
281 print "\t", &tab(3, "MEMBER_TO_FPTR(Perl_$check{$_}),"), "\t/* $_ */\n";
287 #ifdef PERL_CHECK_INITED
289 #endif /* #ifdef PERL_CHECK_INITED */
293 # Emit allowed argument types.
298 #ifndef PERL_GLOBAL_STRUCT_INIT
301 EXTCONST U32 PL_opargs[];
303 EXTCONST U32 PL_opargs[] = {
309 'A', 3, # array value
313 'R', 7, # scalar reference
323 '$', 6, # svop_or_padop
325 '"', 8, # pvop_or_svop
328 '%', 11, # baseop_or_unop
329 '-', 12, # filestatop
334 'm' => 1, # needs stack mark
335 'f' => 2, # fold constants
336 's' => 4, # always produces scalar
337 't' => 8, # needs target scalar
338 'T' => 8 | 256, # ... which may be lexical
339 'i' => 16, # always produces integer
340 'I' => 32, # has corresponding int op
341 'd' => 64, # danger, unknown side effects
342 'u' => 128, # defaults to $_
353 my $flags = $flags{$op};
354 for my $flag (keys %opflags) {
355 if ($flags =~ s/$flag//) {
356 die "Flag collision for '$op' ($flags{$op}, $flag)"
357 if $argsum & $opflags{$flag};
358 $argsum |= $opflags{$flag};
361 die qq[Opcode '$op' has no class indicator ($flags{$op} => $flags)]
362 unless exists $opclass{$flags};
363 $argsum |= $opclass{$flags} << $OCSHIFT;
364 my $argshift = $OASHIFT;
365 for my $arg (split(' ',$args{$op})) {
367 # record opnums of these opnames
368 $OP_IS_SOCKET{$op} = $opnum{$op} if $arg =~ s/s//;
369 $OP_IS_FILETEST{$op} = $opnum{$op} if $arg =~ s/-//;
370 $OP_IS_FT_ACCESS{$op} = $opnum{$op} if $arg =~ s/\+//;
372 my $argnum = ($arg =~ s/\?//) ? 8 : 0;
373 die "op = $op, arg = $arg\n"
374 unless exists $argnum{$arg};
375 $argnum += $argnum{$arg};
376 die "Argument overflow for '$op'\n"
377 if $argshift >= $ARGBITS ||
378 $argnum > ((1 << ($ARGBITS - $argshift)) - 1);
379 $argsum += $argnum << $argshift;
382 $argsum = sprintf("0x%08x", $argsum);
383 print "\t", &tab(3, "$argsum,"), "/* $op */\n";
390 #endif /* !PERL_GLOBAL_STRUCT_INIT */
396 # Emit OP_IS_* macros
398 print ON <<EO_OP_IS_COMMENT;
400 /* the OP_IS_(SOCKET|FILETEST) macros are optimized to a simple range
401 check because all the member OPs are contiguous in opcode.pl
402 <DATA> table. opcode.pl verifies the range contiguity. */
406 gen_op_is_macro( \%OP_IS_SOCKET, 'OP_IS_SOCKET');
407 gen_op_is_macro( \%OP_IS_FILETEST, 'OP_IS_FILETEST');
408 gen_op_is_macro( \%OP_IS_FT_ACCESS, 'OP_IS_FILETEST_ACCESS');
410 sub gen_op_is_macro {
411 my ($op_is, $macname) = @_;
414 # get opnames whose numbers are lowest and highest
415 my ($first, @rest) = sort {
416 $op_is->{$a} <=> $op_is->{$b}
419 my $last = pop @rest; # @rest slurped, get its last
420 die "invalid range of ops: $first .. $last" unless $last;
422 print ON "#define $macname(op) \\\n\t(";
424 # verify that op-ct matches 1st..last range (and fencepost)
425 # (we know there are no dups)
426 if ( $op_is->{$last} - $op_is->{$first} == scalar @rest + 1) {
428 # contiguous ops -> optimized version
429 print ON "(op) >= OP_" . uc($first) . " && (op) <= OP_" . uc($last);
433 print ON join(" || \\\n\t ",
434 map { "(op) == OP_" . uc() } sort keys %$op_is);
440 print OC "/* ex: set ro: */\n";
441 print ON "/* ex: set ro: */\n";
443 close OC or die "Error closing opcode.h: $!";
444 close ON or die "Error closing opnames.h: $!";
446 foreach ('opcode.h', 'opnames.h') {
447 safer_rename_silent $_, "$_-old";
449 safer_rename $opcode_new, 'opcode.h';
450 safer_rename $opname_new, 'opnames.h';
452 my $pp_proto_new = 'pp_proto.h-new';
453 my $pp_sym_new = 'pp.sym-new';
455 open PP, ">$pp_proto_new" or die "Error creating $pp_proto_new: $!";
457 open PPSYM, ">$pp_sym_new" or die "Error creating $pp_sym_new: $!";
461 /* -*- buffer-read-only: t -*-
462 !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
463 This file is built by opcode.pl from its data. Any changes made here
470 # -*- buffer-read-only: t -*-
472 # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
473 # This file is built by opcode.pl from its data. Any changes made here
480 for (sort keys %ckname) {
481 print PP "PERL_CKDEF(Perl_$_)\n";
482 print PPSYM "Perl_$_\n";
483 #OP *\t", &tab(3,$_),"(OP* o);\n";
489 next if /^i_(pre|post)(inc|dec)$/;
491 print PP "PERL_PPDEF(Perl_pp_$_)\n";
492 print PPSYM "Perl_pp_$_\n";
494 print PP "\n/* ex: set ro: */\n";
495 print PPSYM "\n# ex: set ro:\n";
497 close PP or die "Error closing pp_proto.h: $!";
498 close PPSYM or die "Error closing pp.sym: $!";
500 foreach ('pp_proto.h', 'pp.sym') {
501 safer_rename_silent $_, "$_-old";
503 safer_rename $pp_proto_new, 'pp_proto.h';
504 safer_rename $pp_sym_new, 'pp.sym';
507 foreach ('opcode.h', 'opnames.h', 'pp_proto.h', 'pp.sym') {
508 1 while unlink "$_-old";
512 ###########################################################################
515 $t .= "\t" x ($l - (length($t) + 1) / 8);
518 ###########################################################################
520 # Some comments about 'T' opcode classifier:
522 # Safe to set if the ppcode uses:
523 # tryAMAGICbin, tryAMAGICun, SETn, SETi, SETu, PUSHn, PUSHTARG, SETTARG,
524 # SETs(TARG), XPUSHn, XPUSHu,
526 # Unsafe to set if the ppcode uses dTARG or [X]RETPUSH[YES|NO|UNDEF]
528 # lt and friends do SETs (including ncmp, but not scmp)
530 # Additional mode of failure: the opcode can modify TARG before it "used"
531 # all the arguments (or may call an external function which does the same).
532 # If the target coincides with one of the arguments ==> kaboom.
534 # pp.c pos substr each not OK (RETPUSHUNDEF)
535 # substr vec also not OK due to LV to target (are they???)
536 # ref not OK (RETPUSHNO)
537 # trans not OK (dTARG; TARG = sv_newmortal();)
538 # ucfirst etc not OK: TMP arg processed inplace
539 # quotemeta not OK (unsafe when TARG == arg)
540 # each repeat not OK too due to list context
541 # pack split - unknown whether they are safe
542 # sprintf: is calling do_sprintf(TARG,...) which can act on TARG
543 # before other args are processed.
545 # Suspicious wrt "additional mode of failure" (and only it):
546 # schop, chop, postinc/dec, bit_and etc, negate, complement.
548 # Also suspicious: 4-arg substr, sprintf, uc/lc (POK_only), reverse, pack.
550 # substr/vec: doing TAINT_off()???
553 # readline - unknown whether it is safe
554 # match subst not OK (dTARG)
555 # grepwhile not OK (not always setting)
556 # join not OK (unsafe when TARG == arg)
558 # Suspicious wrt "additional mode of failure": concat (dealt with
559 # in ck_sassign()), join (same).
562 # mapwhile flip caller not OK (not always setting)
565 # backtick glob warn die not OK (not always setting)
566 # warn not OK (RETPUSHYES)
567 # open fileno getc sysread syswrite ioctl accept shutdown
568 # ftsize(etc) readlink telldir fork alarm getlogin not OK (RETPUSHUNDEF)
569 # umask select not OK (XPUSHs(&PL_sv_undef);)
570 # fileno getc sysread syswrite tell not OK (meth("FILENO" "GETC"))
571 # sselect shm* sem* msg* syscall - unknown whether they are safe
572 # gmtime not OK (list context)
574 # Suspicious wrt "additional mode of failure": warn, die, select.
578 # New ops always go at the end
579 # The restriction on having custom as the last op has been removed
581 # A recapitulation of the format of this file:
582 # The file consists of five columns: the name of the op, an English
583 # description, the name of the "check" routine used to optimize this
584 # operation, some flags, and a description of the operands.
586 # The flags consist of options followed by a mandatory op class signifier
589 # baseop - 0 unop - 1 binop - 2
590 # logop - | listop - @ pmop - /
591 # padop/svop - $ padop - # (unused) loop - {
592 # baseop/unop - % loopexop - } filestatop - -
593 # pvop/svop - " cop - ;
596 # needs stack mark - m
597 # needs constant folding - f
598 # produces a scalar - s
599 # produces an integer - i
601 # target can be in a pad - T
602 # has a corresponding integer version - I
603 # has side effects - d
604 # uses $_ if no argument given - u
606 # Values for the operands are:
607 # scalar - S list - L array - A
608 # hash - H sub (CV) - C file - F
609 # socket - Fs filetest - F- filetest_access - F-+
612 # "?" denotes an optional operand.
616 null null operation ck_null 0
618 scalar scalar ck_fun s% S
622 pushmark pushmark ck_null s0
623 wantarray wantarray ck_null is0
625 const constant item ck_svconst s$
627 gvsv scalar variable ck_null ds$
628 gv glob value ck_null ds$
629 gelem glob elem ck_null d2 S S
630 padsv private variable ck_null ds0
631 padav private array ck_null d0
632 padhv private hash ck_null d0
633 padany private value ck_null d0
635 pushre push regexp ck_null d/
637 # References and stuff.
639 rv2gv ref-to-glob cast ck_rvconst ds1
640 rv2sv scalar dereference ck_rvconst ds1
641 av2arylen array length ck_null is1
642 rv2cv subroutine dereference ck_rvconst d1
643 anoncode anonymous subroutine ck_anoncode $
644 prototype subroutine prototype ck_null s% S
645 refgen reference constructor ck_spair m1 L
646 srefgen single ref constructor ck_null fs1 S
647 ref reference-type operator ck_fun stu% S?
648 bless bless ck_fun s@ S S?
652 backtick quoted execution (``, qx) ck_open tu% S?
653 # glob defaults its first arg to $_
654 glob glob ck_glob t@ S?
655 readline <HANDLE> ck_readline t% F?
656 rcatline append I/O operator ck_null t$
658 # Bindable operators.
660 regcmaybe regexp internal guard ck_fun s1 S
661 regcreset regexp internal reset ck_fun s1 S
662 regcomp regexp compilation ck_null s| S
663 match pattern match (m//) ck_match d/
664 qr pattern quote (qr//) ck_match s/
665 subst substitution (s///) ck_match dis/ S
666 substcont substitution iterator ck_null dis|
667 trans transliteration (tr///) ck_match is" S
670 # sassign is special-cased for op class
672 sassign scalar assignment ck_sassign s0
673 aassign list assignment ck_null t2 L L
675 chop chop ck_spair mts% L
676 schop scalar chop ck_null stu% S?
677 chomp chomp ck_spair mTs% L
678 schomp scalar chomp ck_null sTu% S?
679 defined defined operator ck_defined isu% S?
680 undef undef operator ck_lfun s% S?
681 study study ck_fun su% S?
682 pos match position ck_lfun stu% S?
684 preinc preincrement (++) ck_lfun dIs1 S
685 i_preinc integer preincrement (++) ck_lfun dis1 S
686 predec predecrement (--) ck_lfun dIs1 S
687 i_predec integer predecrement (--) ck_lfun dis1 S
688 postinc postincrement (++) ck_lfun dIst1 S
689 i_postinc integer postincrement (++) ck_lfun disT1 S
690 postdec postdecrement (--) ck_lfun dIst1 S
691 i_postdec integer postdecrement (--) ck_lfun disT1 S
693 # Ordinary operators.
695 pow exponentiation (**) ck_null fsT2 S S
697 multiply multiplication (*) ck_null IfsT2 S S
698 i_multiply integer multiplication (*) ck_null ifsT2 S S
699 divide division (/) ck_null IfsT2 S S
700 i_divide integer division (/) ck_null ifsT2 S S
701 modulo modulus (%) ck_null IifsT2 S S
702 i_modulo integer modulus (%) ck_null ifsT2 S S
703 repeat repeat (x) ck_repeat mt2 L S
705 add addition (+) ck_null IfsT2 S S
706 i_add integer addition (+) ck_null ifsT2 S S
707 subtract subtraction (-) ck_null IfsT2 S S
708 i_subtract integer subtraction (-) ck_null ifsT2 S S
709 concat concatenation (.) or string ck_concat fsT2 S S
710 stringify string ck_fun fsT@ S
712 left_shift left bitshift (<<) ck_bitop fsT2 S S
713 right_shift right bitshift (>>) ck_bitop fsT2 S S
715 lt numeric lt (<) ck_null Iifs2 S S
716 i_lt integer lt (<) ck_null ifs2 S S
717 gt numeric gt (>) ck_null Iifs2 S S
718 i_gt integer gt (>) ck_null ifs2 S S
719 le numeric le (<=) ck_null Iifs2 S S
720 i_le integer le (<=) ck_null ifs2 S S
721 ge numeric ge (>=) ck_null Iifs2 S S
722 i_ge integer ge (>=) ck_null ifs2 S S
723 eq numeric eq (==) ck_null Iifs2 S S
724 i_eq integer eq (==) ck_null ifs2 S S
725 ne numeric ne (!=) ck_null Iifs2 S S
726 i_ne integer ne (!=) ck_null ifs2 S S
727 ncmp numeric comparison (<=>) ck_null Iifst2 S S
728 i_ncmp integer comparison (<=>) ck_null ifst2 S S
730 slt string lt ck_null ifs2 S S
731 sgt string gt ck_null ifs2 S S
732 sle string le ck_null ifs2 S S
733 sge string ge ck_null ifs2 S S
734 seq string eq ck_null ifs2 S S
735 sne string ne ck_null ifs2 S S
736 scmp string comparison (cmp) ck_null ifst2 S S
738 bit_and bitwise and (&) ck_bitop fst2 S S
739 bit_xor bitwise xor (^) ck_bitop fst2 S S
740 bit_or bitwise or (|) ck_bitop fst2 S S
742 negate negation (-) ck_null Ifst1 S
743 i_negate integer negation (-) ck_null ifsT1 S
744 not not ck_null ifs1 S
745 complement 1's complement (~) ck_bitop fst1 S
747 smartmatch smart match ck_smartmatch s2
749 # High falutin' math.
751 atan2 atan2 ck_fun fsT@ S S
752 sin sin ck_fun fsTu% S?
753 cos cos ck_fun fsTu% S?
754 rand rand ck_fun sT% S?
755 srand srand ck_fun s% S?
756 exp exp ck_fun fsTu% S?
757 log log ck_fun fsTu% S?
758 sqrt sqrt ck_fun fsTu% S?
762 int int ck_fun fsTu% S?
763 hex hex ck_fun fsTu% S?
764 oct oct ck_fun fsTu% S?
765 abs abs ck_fun fsTu% S?
769 length length ck_fun ifsTu% S?
770 substr substr ck_substr st@ S S S? S?
771 vec vec ck_fun ist@ S S S
773 index index ck_index isT@ S S S?
774 rindex rindex ck_index isT@ S S S?
776 sprintf sprintf ck_fun mst@ S L
777 formline formline ck_fun ms@ S L
778 ord ord ck_fun ifsTu% S?
779 chr chr ck_fun fsTu% S?
780 crypt crypt ck_fun fsT@ S S
781 ucfirst ucfirst ck_fun fstu% S?
782 lcfirst lcfirst ck_fun fstu% S?
783 uc uc ck_fun fstu% S?
784 lc lc ck_fun fstu% S?
785 quotemeta quotemeta ck_fun fstu% S?
789 rv2av array dereference ck_rvconst dt1
790 aelemfast constant array element ck_null s$ A S
791 aelem array element ck_null s2 A S
792 aslice array slice ck_null m@ A L
794 aeach each on array ck_each % A
795 akeys keys on array ck_each t% A
796 avalues values on array ck_each t% A
800 each each ck_each % H
801 values values ck_each t% H
802 keys keys ck_each t% H
803 delete delete ck_delete % S
804 exists exists ck_exists is% S
805 rv2hv hash dereference ck_rvconst dt1
806 helem hash element ck_null s2 H S
807 hslice hash slice ck_null m@ H L
809 # Explosives and implosives.
811 unpack unpack ck_unpack @ S S?
812 pack pack ck_fun mst@ S L
813 split split ck_split t@ S S S
814 join join or string ck_join mst@ S L
818 list list ck_null m@ L
819 lslice list slice ck_null 2 H L L
820 anonlist anonymous list ([]) ck_fun ms@ L
821 anonhash anonymous hash ({}) ck_fun ms@ L
823 splice splice ck_fun m@ A S? S? L
824 push push ck_fun imsT@ A L
825 pop pop ck_shift s% A?
826 shift shift ck_shift s% A?
827 unshift unshift ck_fun imsT@ A L
828 sort sort ck_sort dm@ C? L
829 reverse reverse ck_fun mt@ L
831 grepstart grep ck_grep dm@ C L
832 grepwhile grep iterator ck_null dt|
834 mapstart map ck_grep dm@ C L
835 mapwhile map iterator ck_null dt|
839 range flipflop ck_null | S S
840 flip range (or flip) ck_null 1 S S
841 flop range (or flop) ck_null 1
845 and logical and (&&) ck_null |
846 or logical or (||) ck_null |
847 xor logical xor ck_null fs2 S S
848 dor defined or (//) ck_null |
849 cond_expr conditional expression ck_null d|
850 andassign logical and assignment (&&=) ck_null s|
851 orassign logical or assignment (||=) ck_null s|
852 dorassign defined or assignment (//=) ck_null s|
854 method method lookup ck_method d1
855 entersub subroutine entry ck_subr dmt1 L
856 leavesub subroutine exit ck_null 1
857 leavesublv lvalue subroutine return ck_null 1
858 caller caller ck_fun t% S?
859 warn warn ck_fun imst@ L
860 die die ck_die dimst@ L
861 reset symbol reset ck_fun is% S?
863 lineseq line sequence ck_null @
864 nextstate next statement ck_null s;
865 dbstate debug next statement ck_null s;
866 unstack iteration finalizer ck_null s0
867 enter block entry ck_null 0
868 leave block exit ck_null @
869 scope block ck_null @
870 enteriter foreach loop entry ck_null d{
871 iter foreach loop iterator ck_null 0
872 enterloop loop entry ck_null d{
873 leaveloop loop exit ck_null 2
874 return return ck_return dm@ L
875 last last ck_null ds}
876 next next ck_null ds}
877 redo redo ck_null ds}
878 dump dump ck_null ds}
879 goto goto ck_null ds}
880 exit exit ck_exit ds% S?
881 method_named method with known name ck_null d$
883 entergiven given() ck_null d|
884 leavegiven leave given block ck_null 1
885 enterwhen when() ck_null d|
886 leavewhen leave when block ck_null 1
887 break break ck_null 0
888 continue continue ck_null 0
892 open open ck_open ismt@ F S? L
893 close close ck_fun is% F?
894 pipe_op pipe ck_fun is@ F F
896 fileno fileno ck_fun ist% F
897 umask umask ck_fun ist% S?
898 binmode binmode ck_fun s@ F S?
900 tie tie ck_fun idms@ R S L
901 untie untie ck_fun is% R
902 tied tied ck_fun s% R
903 dbmopen dbmopen ck_fun is@ H S S
904 dbmclose dbmclose ck_fun is% H
906 sselect select system call ck_select t@ S S S S
907 select select ck_select st@ F?
909 getc getc ck_eof st% F?
910 read read ck_fun imst@ F R S S?
911 enterwrite write ck_fun dis% F?
912 leavewrite write exit ck_null 1
914 prtf printf ck_listiob ims@ F? L
915 print print ck_listiob ims@ F? L
916 say say ck_listiob ims@ F? L
918 sysopen sysopen ck_fun s@ F S S S?
919 sysseek sysseek ck_fun s@ F S S
920 sysread sysread ck_fun imst@ F R S S?
921 syswrite syswrite ck_fun imst@ F S S? S?
923 eof eof ck_eof is% F?
924 tell tell ck_fun st% F?
925 seek seek ck_fun s@ F S S
926 # truncate really behaves as if it had both "S S" and "F S"
927 truncate truncate ck_trunc is@ S S
929 fcntl fcntl ck_fun st@ F S S
930 ioctl ioctl ck_fun st@ F S S
931 flock flock ck_fun isT@ F S
933 # Sockets. OP_IS_SOCKET wants them consecutive (so moved 1st 2)
935 send send ck_fun imst@ Fs S S S?
936 recv recv ck_fun imst@ Fs R S S
938 socket socket ck_fun is@ Fs S S S
939 sockpair socketpair ck_fun is@ Fs Fs S S S
941 bind bind ck_fun is@ Fs S
942 connect connect ck_fun is@ Fs S
943 listen listen ck_fun is@ Fs S
944 accept accept ck_fun ist@ Fs Fs
945 shutdown shutdown ck_fun ist@ Fs S
947 gsockopt getsockopt ck_fun is@ Fs S S
948 ssockopt setsockopt ck_fun is@ Fs S S S
950 getsockname getsockname ck_fun is% Fs
951 getpeername getpeername ck_fun is% Fs
953 # Stat calls. OP_IS_FILETEST wants them consecutive.
955 lstat lstat ck_ftst u- F
956 stat stat ck_ftst u- F
957 ftrread -R ck_ftst isu- F-+
958 ftrwrite -W ck_ftst isu- F-+
959 ftrexec -X ck_ftst isu- F-+
960 fteread -r ck_ftst isu- F-+
961 ftewrite -w ck_ftst isu- F-+
962 fteexec -x ck_ftst isu- F-+
963 ftis -e ck_ftst isu- F-
964 ftsize -s ck_ftst istu- F-
965 ftmtime -M ck_ftst stu- F-
966 ftatime -A ck_ftst stu- F-
967 ftctime -C ck_ftst stu- F-
968 ftrowned -O ck_ftst isu- F-
969 fteowned -o ck_ftst isu- F-
970 ftzero -z ck_ftst isu- F-
971 ftsock -S ck_ftst isu- F-
972 ftchr -c ck_ftst isu- F-
973 ftblk -b ck_ftst isu- F-
974 ftfile -f ck_ftst isu- F-
975 ftdir -d ck_ftst isu- F-
976 ftpipe -p ck_ftst isu- F-
977 ftsuid -u ck_ftst isu- F-
978 ftsgid -g ck_ftst isu- F-
979 ftsvtx -k ck_ftst isu- F-
980 ftlink -l ck_ftst isu- F-
981 fttty -t ck_ftst is- F-
982 fttext -T ck_ftst isu- F-
983 ftbinary -B ck_ftst isu- F-
987 # chdir really behaves as if it had both "S?" and "F?"
988 chdir chdir ck_chdir isT% S?
989 chown chown ck_fun imsT@ L
990 chroot chroot ck_fun isTu% S?
991 unlink unlink ck_fun imsTu@ L
992 chmod chmod ck_fun imsT@ L
993 utime utime ck_fun imsT@ L
994 rename rename ck_fun isT@ S S
995 link link ck_fun isT@ S S
996 symlink symlink ck_fun isT@ S S
997 readlink readlink ck_fun stu% S?
998 mkdir mkdir ck_fun isTu@ S? S?
999 rmdir rmdir ck_fun isTu% S?
1003 open_dir opendir ck_fun is@ F S
1004 readdir readdir ck_fun % F
1005 telldir telldir ck_fun st% F
1006 seekdir seekdir ck_fun s@ F S
1007 rewinddir rewinddir ck_fun s% F
1008 closedir closedir ck_fun is% F
1012 fork fork ck_null ist0
1013 wait wait ck_null isT0
1014 waitpid waitpid ck_fun isT@ S S
1015 system system ck_exec imsT@ S? L
1016 exec exec ck_exec dimsT@ S? L
1017 kill kill ck_fun dimsT@ L
1018 getppid getppid ck_null isT0
1019 getpgrp getpgrp ck_fun isT% S?
1020 setpgrp setpgrp ck_fun isT@ S? S?
1021 getpriority getpriority ck_fun isT@ S S
1022 setpriority setpriority ck_fun isT@ S S S
1026 # NOTE: MacOS patches the 'i' of time() away later when the interpreter
1027 # is created because in MacOS time() is already returning times > 2**31-1,
1028 # that is, non-integers.
1030 time time ck_null isT0
1032 localtime localtime ck_fun t% S?
1033 gmtime gmtime ck_fun t% S?
1034 alarm alarm ck_fun istu% S?
1035 sleep sleep ck_fun isT% S?
1039 shmget shmget ck_fun imst@ S S S
1040 shmctl shmctl ck_fun imst@ S S S
1041 shmread shmread ck_fun imst@ S S S S
1042 shmwrite shmwrite ck_fun imst@ S S S S
1046 msgget msgget ck_fun imst@ S S
1047 msgctl msgctl ck_fun imst@ S S S
1048 msgsnd msgsnd ck_fun imst@ S S S
1049 msgrcv msgrcv ck_fun imst@ S S S S S
1053 semop semop ck_fun imst@ S S
1054 semget semget ck_fun imst@ S S S
1055 semctl semctl ck_fun imst@ S S S S
1059 require require ck_require du% S?
1060 dofile do "file" ck_fun d1 S
1061 hintseval eval hints ck_svconst s$
1062 entereval eval "string" ck_eval d% S
1063 leaveeval eval "string" exit ck_null 1 S
1064 #evalonce eval constant string ck_null d1 S
1065 entertry eval {block} ck_null |
1066 leavetry eval {block} exit ck_null @
1070 ghbyname gethostbyname ck_fun % S
1071 ghbyaddr gethostbyaddr ck_fun @ S S
1072 ghostent gethostent ck_null 0
1073 gnbyname getnetbyname ck_fun % S
1074 gnbyaddr getnetbyaddr ck_fun @ S S
1075 gnetent getnetent ck_null 0
1076 gpbyname getprotobyname ck_fun % S
1077 gpbynumber getprotobynumber ck_fun @ S
1078 gprotoent getprotoent ck_null 0
1079 gsbyname getservbyname ck_fun @ S S
1080 gsbyport getservbyport ck_fun @ S S
1081 gservent getservent ck_null 0
1082 shostent sethostent ck_fun is% S
1083 snetent setnetent ck_fun is% S
1084 sprotoent setprotoent ck_fun is% S
1085 sservent setservent ck_fun is% S
1086 ehostent endhostent ck_null is0
1087 enetent endnetent ck_null is0
1088 eprotoent endprotoent ck_null is0
1089 eservent endservent ck_null is0
1090 gpwnam getpwnam ck_fun % S
1091 gpwuid getpwuid ck_fun % S
1092 gpwent getpwent ck_null 0
1093 spwent setpwent ck_null is0
1094 epwent endpwent ck_null is0
1095 ggrnam getgrnam ck_fun % S
1096 ggrgid getgrgid ck_fun % S
1097 ggrent getgrent ck_null 0
1098 sgrent setgrent ck_null is0
1099 egrent endgrent ck_null is0
1100 getlogin getlogin ck_null st0
1104 syscall syscall ck_fun imst@ S L
1106 # For multi-threading
1107 lock lock ck_rfun s% R
1113 custom unknown custom operator ck_null 0