Eliminate the OP_SETSTATE, which had been disabled by change 4309.
Nicholas Clark [Sat, 26 Jan 2008 10:46:12 +0000 (10:46 +0000)]
p4raw-id: //depot/perl@33072

dump.c
ext/Opcode/Opcode.pm
op.c
opcode.h
opcode.pl
opnames.h
pp.sym
pp_hot.c
pp_proto.h

diff --git a/dump.c b/dump.c
index 3147286..7d8bf0a 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1052,7 +1052,6 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
        Perl_dump_indent(aTHX_ level, file, "SV = %s\n", SvPEEK(cSVOPo_sv));
 #endif
        break;
-    case OP_SETSTATE:
     case OP_NEXTSTATE:
     case OP_DBSTATE:
        if (CopLINE(cCOPo))
@@ -2786,7 +2785,6 @@ Perl_do_op_xmldump(pTHX_ I32 level, PerlIO *file, const OP *o)
        }
        do_op_xmldump(level+1, file, CvROOT(cSVOPo_sv));
        break;
-    case OP_SETSTATE:
     case OP_NEXTSTATE:
     case OP_DBSTATE:
        if (CopLINE(cCOPo))
index b552f90..386db79 100644 (file)
@@ -6,7 +6,7 @@ use strict;
 
 our($VERSION, @ISA, @EXPORT_OK);
 
-$VERSION = "1.12";
+$VERSION = "1.13";
 
 use Carp;
 use Exporter ();
@@ -332,7 +332,7 @@ invert_opset function.
 
     cond_expr flip flop andassign orassign dorassign and or dor xor
 
-    warn die lineseq nextstate scope enter leave setstate
+    warn die lineseq nextstate scope enter leave
 
     rv2cv anoncode prototype
 
diff --git a/op.c b/op.c
index e5fed9d..b3f765e 100644 (file)
--- a/op.c
+++ b/op.c
@@ -484,7 +484,7 @@ Perl_op_free(pTHX_ OP *o)
 
     /* COP* is not cleared by op_clear() so that we may track line
      * numbers etc even after null() */
-    if (type == OP_NEXTSTATE || type == OP_SETSTATE || type == OP_DBSTATE) {
+    if (type == OP_NEXTSTATE || type == OP_DBSTATE) {
        cop_free((COP*)o);
     }
 
@@ -901,10 +901,8 @@ Perl_scalarvoid(pTHX_ OP *o)
     }
 
     if (o->op_type == OP_NEXTSTATE
-       || o->op_type == OP_SETSTATE
        || o->op_type == OP_DBSTATE
        || (o->op_type == OP_NULL && (o->op_targ == OP_NEXTSTATE
-                                     || o->op_targ == OP_SETSTATE
                                      || o->op_targ == OP_DBSTATE)))
        PL_curcop = (COP*)o;            /* for warning below */
 
@@ -7972,7 +7970,6 @@ Perl_peep(pTHX_ register OP *o)
        o->op_opt = 1;
        PL_op = o;
        switch (o->op_type) {
-       case OP_SETSTATE:
        case OP_NEXTSTATE:
        case OP_DBSTATE:
            PL_curcop = ((COP*)o);              /* for warnings */
@@ -8042,8 +8039,7 @@ Perl_peep(pTHX_ register OP *o)
            goto nothin;
        case OP_NULL:
            if (o->op_targ == OP_NEXTSTATE
-               || o->op_targ == OP_DBSTATE
-               || o->op_targ == OP_SETSTATE)
+               || o->op_targ == OP_DBSTATE)
            {
                PL_curcop = ((COP*)o);
            }
index a7ca152..5c779c4 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -230,7 +230,6 @@ EXTCONST char* const PL_op_name[] = {
        "dump",
        "goto",
        "exit",
-       "setstate",
        "method_named",
        "entergiven",
        "leavegiven",
@@ -602,7 +601,6 @@ EXTCONST char* const PL_op_desc[] = {
        "dump",
        "goto",
        "exit",
-       "set statement info",
        "method with known name",
        "given()",
        "leave given block",
@@ -988,7 +986,6 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
        MEMBER_TO_FPTR(Perl_pp_goto),   /* Perl_pp_dump */
        MEMBER_TO_FPTR(Perl_pp_goto),
        MEMBER_TO_FPTR(Perl_pp_exit),
-       MEMBER_TO_FPTR(Perl_pp_setstate),
        MEMBER_TO_FPTR(Perl_pp_method_named),
        MEMBER_TO_FPTR(Perl_pp_entergiven),
        MEMBER_TO_FPTR(Perl_pp_leavegiven),
@@ -1371,7 +1368,6 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */
        MEMBER_TO_FPTR(Perl_ck_null),   /* dump */
        MEMBER_TO_FPTR(Perl_ck_null),   /* goto */
        MEMBER_TO_FPTR(Perl_ck_exit),   /* exit */
-       MEMBER_TO_FPTR(Perl_ck_null),   /* setstate */
        MEMBER_TO_FPTR(Perl_ck_null),   /* method_named */
        MEMBER_TO_FPTR(Perl_ck_null),   /* entergiven */
        MEMBER_TO_FPTR(Perl_ck_null),   /* leavegiven */
@@ -1748,7 +1744,6 @@ EXTCONST U32 PL_opargs[] = {
        0x00001a44,     /* dump */
        0x00001a44,     /* goto */
        0x00013644,     /* exit */
-       0x00001404,     /* setstate */
        0x00000c40,     /* method_named */
        0x00000640,     /* entergiven */
        0x00000200,     /* leavegiven */
index 9a022ca..8a372df 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -841,7 +841,6 @@ redo                redo                    ck_null         ds}
 dump           dump                    ck_null         ds}     
 goto           goto                    ck_null         ds}     
 exit           exit                    ck_exit         ds%     S?
-setstate       set statement info      ck_null         s;
 method_named   method with known name  ck_null         d$
 
 entergiven     given()                 ck_null         d|
index e0585fb..4f73f1e 100644 (file)
--- a/opnames.h
+++ b/opnames.h
@@ -212,178 +212,177 @@ typedef enum opcode {
        OP_DUMP,        /* 194 */
        OP_GOTO,        /* 195 */
        OP_EXIT,        /* 196 */
-       OP_SETSTATE,    /* 197 */
-       OP_METHOD_NAMED,/* 198 */
-       OP_ENTERGIVEN,  /* 199 */
-       OP_LEAVEGIVEN,  /* 200 */
-       OP_ENTERWHEN,   /* 201 */
-       OP_LEAVEWHEN,   /* 202 */
-       OP_BREAK,       /* 203 */
-       OP_CONTINUE,    /* 204 */
-       OP_OPEN,        /* 205 */
-       OP_CLOSE,       /* 206 */
-       OP_PIPE_OP,     /* 207 */
-       OP_FILENO,      /* 208 */
-       OP_UMASK,       /* 209 */
-       OP_BINMODE,     /* 210 */
-       OP_TIE,         /* 211 */
-       OP_UNTIE,       /* 212 */
-       OP_TIED,        /* 213 */
-       OP_DBMOPEN,     /* 214 */
-       OP_DBMCLOSE,    /* 215 */
-       OP_SSELECT,     /* 216 */
-       OP_SELECT,      /* 217 */
-       OP_GETC,        /* 218 */
-       OP_READ,        /* 219 */
-       OP_ENTERWRITE,  /* 220 */
-       OP_LEAVEWRITE,  /* 221 */
-       OP_PRTF,        /* 222 */
-       OP_PRINT,       /* 223 */
-       OP_SAY,         /* 224 */
-       OP_SYSOPEN,     /* 225 */
-       OP_SYSSEEK,     /* 226 */
-       OP_SYSREAD,     /* 227 */
-       OP_SYSWRITE,    /* 228 */
-       OP_SEND,        /* 229 */
-       OP_RECV,        /* 230 */
-       OP_EOF,         /* 231 */
-       OP_TELL,        /* 232 */
-       OP_SEEK,        /* 233 */
-       OP_TRUNCATE,    /* 234 */
-       OP_FCNTL,       /* 235 */
-       OP_IOCTL,       /* 236 */
-       OP_FLOCK,       /* 237 */
-       OP_SOCKET,      /* 238 */
-       OP_SOCKPAIR,    /* 239 */
-       OP_BIND,        /* 240 */
-       OP_CONNECT,     /* 241 */
-       OP_LISTEN,      /* 242 */
-       OP_ACCEPT,      /* 243 */
-       OP_SHUTDOWN,    /* 244 */
-       OP_GSOCKOPT,    /* 245 */
-       OP_SSOCKOPT,    /* 246 */
-       OP_GETSOCKNAME, /* 247 */
-       OP_GETPEERNAME, /* 248 */
-       OP_LSTAT,       /* 249 */
-       OP_STAT,        /* 250 */
-       OP_FTRREAD,     /* 251 */
-       OP_FTRWRITE,    /* 252 */
-       OP_FTREXEC,     /* 253 */
-       OP_FTEREAD,     /* 254 */
-       OP_FTEWRITE,    /* 255 */
-       OP_FTEEXEC,     /* 256 */
-       OP_FTIS,        /* 257 */
-       OP_FTSIZE,      /* 258 */
-       OP_FTMTIME,     /* 259 */
-       OP_FTATIME,     /* 260 */
-       OP_FTCTIME,     /* 261 */
-       OP_FTROWNED,    /* 262 */
-       OP_FTEOWNED,    /* 263 */
-       OP_FTZERO,      /* 264 */
-       OP_FTSOCK,      /* 265 */
-       OP_FTCHR,       /* 266 */
-       OP_FTBLK,       /* 267 */
-       OP_FTFILE,      /* 268 */
-       OP_FTDIR,       /* 269 */
-       OP_FTPIPE,      /* 270 */
-       OP_FTSUID,      /* 271 */
-       OP_FTSGID,      /* 272 */
-       OP_FTSVTX,      /* 273 */
-       OP_FTLINK,      /* 274 */
-       OP_FTTTY,       /* 275 */
-       OP_FTTEXT,      /* 276 */
-       OP_FTBINARY,    /* 277 */
-       OP_CHDIR,       /* 278 */
-       OP_CHOWN,       /* 279 */
-       OP_CHROOT,      /* 280 */
-       OP_UNLINK,      /* 281 */
-       OP_CHMOD,       /* 282 */
-       OP_UTIME,       /* 283 */
-       OP_RENAME,      /* 284 */
-       OP_LINK,        /* 285 */
-       OP_SYMLINK,     /* 286 */
-       OP_READLINK,    /* 287 */
-       OP_MKDIR,       /* 288 */
-       OP_RMDIR,       /* 289 */
-       OP_OPEN_DIR,    /* 290 */
-       OP_READDIR,     /* 291 */
-       OP_TELLDIR,     /* 292 */
-       OP_SEEKDIR,     /* 293 */
-       OP_REWINDDIR,   /* 294 */
-       OP_CLOSEDIR,    /* 295 */
-       OP_FORK,        /* 296 */
-       OP_WAIT,        /* 297 */
-       OP_WAITPID,     /* 298 */
-       OP_SYSTEM,      /* 299 */
-       OP_EXEC,        /* 300 */
-       OP_KILL,        /* 301 */
-       OP_GETPPID,     /* 302 */
-       OP_GETPGRP,     /* 303 */
-       OP_SETPGRP,     /* 304 */
-       OP_GETPRIORITY, /* 305 */
-       OP_SETPRIORITY, /* 306 */
-       OP_TIME,        /* 307 */
-       OP_TMS,         /* 308 */
-       OP_LOCALTIME,   /* 309 */
-       OP_GMTIME,      /* 310 */
-       OP_ALARM,       /* 311 */
-       OP_SLEEP,       /* 312 */
-       OP_SHMGET,      /* 313 */
-       OP_SHMCTL,      /* 314 */
-       OP_SHMREAD,     /* 315 */
-       OP_SHMWRITE,    /* 316 */
-       OP_MSGGET,      /* 317 */
-       OP_MSGCTL,      /* 318 */
-       OP_MSGSND,      /* 319 */
-       OP_MSGRCV,      /* 320 */
-       OP_SEMOP,       /* 321 */
-       OP_SEMGET,      /* 322 */
-       OP_SEMCTL,      /* 323 */
-       OP_REQUIRE,     /* 324 */
-       OP_DOFILE,      /* 325 */
-       OP_ENTEREVAL,   /* 326 */
-       OP_LEAVEEVAL,   /* 327 */
-       OP_ENTERTRY,    /* 328 */
-       OP_LEAVETRY,    /* 329 */
-       OP_GHBYNAME,    /* 330 */
-       OP_GHBYADDR,    /* 331 */
-       OP_GHOSTENT,    /* 332 */
-       OP_GNBYNAME,    /* 333 */
-       OP_GNBYADDR,    /* 334 */
-       OP_GNETENT,     /* 335 */
-       OP_GPBYNAME,    /* 336 */
-       OP_GPBYNUMBER,  /* 337 */
-       OP_GPROTOENT,   /* 338 */
-       OP_GSBYNAME,    /* 339 */
-       OP_GSBYPORT,    /* 340 */
-       OP_GSERVENT,    /* 341 */
-       OP_SHOSTENT,    /* 342 */
-       OP_SNETENT,     /* 343 */
-       OP_SPROTOENT,   /* 344 */
-       OP_SSERVENT,    /* 345 */
-       OP_EHOSTENT,    /* 346 */
-       OP_ENETENT,     /* 347 */
-       OP_EPROTOENT,   /* 348 */
-       OP_ESERVENT,    /* 349 */
-       OP_GPWNAM,      /* 350 */
-       OP_GPWUID,      /* 351 */
-       OP_GPWENT,      /* 352 */
-       OP_SPWENT,      /* 353 */
-       OP_EPWENT,      /* 354 */
-       OP_GGRNAM,      /* 355 */
-       OP_GGRGID,      /* 356 */
-       OP_GGRENT,      /* 357 */
-       OP_SGRENT,      /* 358 */
-       OP_EGRENT,      /* 359 */
-       OP_GETLOGIN,    /* 360 */
-       OP_SYSCALL,     /* 361 */
-       OP_LOCK,        /* 362 */
-       OP_ONCE,        /* 363 */
-       OP_CUSTOM,      /* 364 */
+       OP_METHOD_NAMED,/* 197 */
+       OP_ENTERGIVEN,  /* 198 */
+       OP_LEAVEGIVEN,  /* 199 */
+       OP_ENTERWHEN,   /* 200 */
+       OP_LEAVEWHEN,   /* 201 */
+       OP_BREAK,       /* 202 */
+       OP_CONTINUE,    /* 203 */
+       OP_OPEN,        /* 204 */
+       OP_CLOSE,       /* 205 */
+       OP_PIPE_OP,     /* 206 */
+       OP_FILENO,      /* 207 */
+       OP_UMASK,       /* 208 */
+       OP_BINMODE,     /* 209 */
+       OP_TIE,         /* 210 */
+       OP_UNTIE,       /* 211 */
+       OP_TIED,        /* 212 */
+       OP_DBMOPEN,     /* 213 */
+       OP_DBMCLOSE,    /* 214 */
+       OP_SSELECT,     /* 215 */
+       OP_SELECT,      /* 216 */
+       OP_GETC,        /* 217 */
+       OP_READ,        /* 218 */
+       OP_ENTERWRITE,  /* 219 */
+       OP_LEAVEWRITE,  /* 220 */
+       OP_PRTF,        /* 221 */
+       OP_PRINT,       /* 222 */
+       OP_SAY,         /* 223 */
+       OP_SYSOPEN,     /* 224 */
+       OP_SYSSEEK,     /* 225 */
+       OP_SYSREAD,     /* 226 */
+       OP_SYSWRITE,    /* 227 */
+       OP_SEND,        /* 228 */
+       OP_RECV,        /* 229 */
+       OP_EOF,         /* 230 */
+       OP_TELL,        /* 231 */
+       OP_SEEK,        /* 232 */
+       OP_TRUNCATE,    /* 233 */
+       OP_FCNTL,       /* 234 */
+       OP_IOCTL,       /* 235 */
+       OP_FLOCK,       /* 236 */
+       OP_SOCKET,      /* 237 */
+       OP_SOCKPAIR,    /* 238 */
+       OP_BIND,        /* 239 */
+       OP_CONNECT,     /* 240 */
+       OP_LISTEN,      /* 241 */
+       OP_ACCEPT,      /* 242 */
+       OP_SHUTDOWN,    /* 243 */
+       OP_GSOCKOPT,    /* 244 */
+       OP_SSOCKOPT,    /* 245 */
+       OP_GETSOCKNAME, /* 246 */
+       OP_GETPEERNAME, /* 247 */
+       OP_LSTAT,       /* 248 */
+       OP_STAT,        /* 249 */
+       OP_FTRREAD,     /* 250 */
+       OP_FTRWRITE,    /* 251 */
+       OP_FTREXEC,     /* 252 */
+       OP_FTEREAD,     /* 253 */
+       OP_FTEWRITE,    /* 254 */
+       OP_FTEEXEC,     /* 255 */
+       OP_FTIS,        /* 256 */
+       OP_FTSIZE,      /* 257 */
+       OP_FTMTIME,     /* 258 */
+       OP_FTATIME,     /* 259 */
+       OP_FTCTIME,     /* 260 */
+       OP_FTROWNED,    /* 261 */
+       OP_FTEOWNED,    /* 262 */
+       OP_FTZERO,      /* 263 */
+       OP_FTSOCK,      /* 264 */
+       OP_FTCHR,       /* 265 */
+       OP_FTBLK,       /* 266 */
+       OP_FTFILE,      /* 267 */
+       OP_FTDIR,       /* 268 */
+       OP_FTPIPE,      /* 269 */
+       OP_FTSUID,      /* 270 */
+       OP_FTSGID,      /* 271 */
+       OP_FTSVTX,      /* 272 */
+       OP_FTLINK,      /* 273 */
+       OP_FTTTY,       /* 274 */
+       OP_FTTEXT,      /* 275 */
+       OP_FTBINARY,    /* 276 */
+       OP_CHDIR,       /* 277 */
+       OP_CHOWN,       /* 278 */
+       OP_CHROOT,      /* 279 */
+       OP_UNLINK,      /* 280 */
+       OP_CHMOD,       /* 281 */
+       OP_UTIME,       /* 282 */
+       OP_RENAME,      /* 283 */
+       OP_LINK,        /* 284 */
+       OP_SYMLINK,     /* 285 */
+       OP_READLINK,    /* 286 */
+       OP_MKDIR,       /* 287 */
+       OP_RMDIR,       /* 288 */
+       OP_OPEN_DIR,    /* 289 */
+       OP_READDIR,     /* 290 */
+       OP_TELLDIR,     /* 291 */
+       OP_SEEKDIR,     /* 292 */
+       OP_REWINDDIR,   /* 293 */
+       OP_CLOSEDIR,    /* 294 */
+       OP_FORK,        /* 295 */
+       OP_WAIT,        /* 296 */
+       OP_WAITPID,     /* 297 */
+       OP_SYSTEM,      /* 298 */
+       OP_EXEC,        /* 299 */
+       OP_KILL,        /* 300 */
+       OP_GETPPID,     /* 301 */
+       OP_GETPGRP,     /* 302 */
+       OP_SETPGRP,     /* 303 */
+       OP_GETPRIORITY, /* 304 */
+       OP_SETPRIORITY, /* 305 */
+       OP_TIME,        /* 306 */
+       OP_TMS,         /* 307 */
+       OP_LOCALTIME,   /* 308 */
+       OP_GMTIME,      /* 309 */
+       OP_ALARM,       /* 310 */
+       OP_SLEEP,       /* 311 */
+       OP_SHMGET,      /* 312 */
+       OP_SHMCTL,      /* 313 */
+       OP_SHMREAD,     /* 314 */
+       OP_SHMWRITE,    /* 315 */
+       OP_MSGGET,      /* 316 */
+       OP_MSGCTL,      /* 317 */
+       OP_MSGSND,      /* 318 */
+       OP_MSGRCV,      /* 319 */
+       OP_SEMOP,       /* 320 */
+       OP_SEMGET,      /* 321 */
+       OP_SEMCTL,      /* 322 */
+       OP_REQUIRE,     /* 323 */
+       OP_DOFILE,      /* 324 */
+       OP_ENTEREVAL,   /* 325 */
+       OP_LEAVEEVAL,   /* 326 */
+       OP_ENTERTRY,    /* 327 */
+       OP_LEAVETRY,    /* 328 */
+       OP_GHBYNAME,    /* 329 */
+       OP_GHBYADDR,    /* 330 */
+       OP_GHOSTENT,    /* 331 */
+       OP_GNBYNAME,    /* 332 */
+       OP_GNBYADDR,    /* 333 */
+       OP_GNETENT,     /* 334 */
+       OP_GPBYNAME,    /* 335 */
+       OP_GPBYNUMBER,  /* 336 */
+       OP_GPROTOENT,   /* 337 */
+       OP_GSBYNAME,    /* 338 */
+       OP_GSBYPORT,    /* 339 */
+       OP_GSERVENT,    /* 340 */
+       OP_SHOSTENT,    /* 341 */
+       OP_SNETENT,     /* 342 */
+       OP_SPROTOENT,   /* 343 */
+       OP_SSERVENT,    /* 344 */
+       OP_EHOSTENT,    /* 345 */
+       OP_ENETENT,     /* 346 */
+       OP_EPROTOENT,   /* 347 */
+       OP_ESERVENT,    /* 348 */
+       OP_GPWNAM,      /* 349 */
+       OP_GPWUID,      /* 350 */
+       OP_GPWENT,      /* 351 */
+       OP_SPWENT,      /* 352 */
+       OP_EPWENT,      /* 353 */
+       OP_GGRNAM,      /* 354 */
+       OP_GGRGID,      /* 355 */
+       OP_GGRENT,      /* 356 */
+       OP_SGRENT,      /* 357 */
+       OP_EGRENT,      /* 358 */
+       OP_GETLOGIN,    /* 359 */
+       OP_SYSCALL,     /* 360 */
+       OP_LOCK,        /* 361 */
+       OP_ONCE,        /* 362 */
+       OP_CUSTOM,      /* 363 */
        OP_max          
 } opcode;
 
-#define MAXO 365
+#define MAXO 364
 #define OP_phoney_INPUT_ONLY -1
 #define OP_phoney_OUTPUT_ONLY -2
 
diff --git a/pp.sym b/pp.sym
index fad5f6e..d6c28f4 100644 (file)
--- a/pp.sym
+++ b/pp.sym
@@ -242,7 +242,6 @@ Perl_pp_redo
 Perl_pp_dump
 Perl_pp_goto
 Perl_pp_exit
-Perl_pp_setstate
 Perl_pp_method_named
 Perl_pp_entergiven
 Perl_pp_leavegiven
index 4fdc404..29215e4 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -78,13 +78,6 @@ PP(pp_null)
     return NORMAL;
 }
 
-PP(pp_setstate)
-{
-    dVAR;
-    PL_curcop = (COP*)PL_op;
-    return NORMAL;
-}
-
 PP(pp_pushmark)
 {
     dVAR;
index e40122e..13cb3cc 100644 (file)
@@ -243,7 +243,6 @@ PERL_PPDEF(Perl_pp_redo)
 PERL_PPDEF(Perl_pp_dump)
 PERL_PPDEF(Perl_pp_goto)
 PERL_PPDEF(Perl_pp_exit)
-PERL_PPDEF(Perl_pp_setstate)
 PERL_PPDEF(Perl_pp_method_named)
 PERL_PPDEF(Perl_pp_entergiven)
 PERL_PPDEF(Perl_pp_leavegiven)