From 383bf72f374cd3608e3ae2a186dd0c3a8d2fbf53 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Tue, 9 Feb 2021 00:52:18 +0000 Subject: A totally new optree structure for try/catch involving three new optypes --- opcode.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'opcode.h') diff --git a/opcode.h b/opcode.h index dc4254cb4e..c808bee65c 100644 --- a/opcode.h +++ b/opcode.h @@ -549,6 +549,9 @@ EXTCONST char* const PL_op_name[] = { "isa", "cmpchain_and", "cmpchain_dup", + "entertrycatch", + "leavetrycatch", + "poptry", "catch", "freed", }; @@ -958,6 +961,9 @@ EXTCONST char* const PL_op_desc[] = { "derived class test", "comparison chaining", "comparand shuffling", + "try {block}", + "try {block} exit", + "pop try", "catch {} block", "freed op", }; @@ -1370,6 +1376,9 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ Perl_pp_isa, Perl_pp_cmpchain_and, Perl_pp_cmpchain_dup, + Perl_pp_entertrycatch, + Perl_pp_leavetrycatch, + Perl_pp_poptry, Perl_pp_catch, } #endif @@ -1778,6 +1787,9 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */ Perl_ck_isa, /* isa */ Perl_ck_null, /* cmpchain_and */ Perl_ck_null, /* cmpchain_dup */ + Perl_ck_trycatch, /* entertrycatch */ + Perl_ck_null, /* leavetrycatch */ + Perl_ck_null, /* poptry */ Perl_ck_null, /* catch */ } #endif @@ -2187,6 +2199,9 @@ EXTCONST U32 PL_opargs[] = { 0x00000204, /* isa */ 0x00000300, /* cmpchain_and */ 0x00000100, /* cmpchain_dup */ + 0x00000300, /* entertrycatch */ + 0x00000400, /* leavetrycatch */ + 0x00000400, /* poptry */ 0x00000300, /* catch */ }; #endif @@ -2855,6 +2870,9 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = { 12, /* isa */ 0, /* cmpchain_and */ 0, /* cmpchain_dup */ + 0, /* entertrycatch */ + -1, /* leavetrycatch */ + -1, /* poptry */ 0, /* catch */ }; @@ -2874,7 +2892,7 @@ EXTCONST I16 PL_op_private_bitdef_ix[] = { */ EXTCONST U16 PL_op_private_bitdefs[] = { - 0x0003, /* scalar, prototype, refgen, srefgen, readline, regcmaybe, regcreset, regcomp, substcont, chop, schop, defined, undef, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, negate, i_negate, not, complement, ucfirst, lcfirst, uc, lc, quotemeta, aeach, avalues, each, pop, shift, grepstart, mapstart, mapwhile, range, and, or, dor, andassign, orassign, dorassign, argcheck, argdefelem, method, method_named, method_super, method_redir, method_redir_super, entergiven, leavegiven, enterwhen, leavewhen, untie, tied, dbmclose, getsockname, getpeername, lstat, stat, readlink, readdir, telldir, rewinddir, closedir, localtime, alarm, require, dofile, entertry, ghbyname, gnbyname, gpbyname, shostent, snetent, sprotoent, sservent, gpwnam, gpwuid, ggrnam, ggrgid, lock, once, fc, anonconst, cmpchain_and, cmpchain_dup, catch */ + 0x0003, /* scalar, prototype, refgen, srefgen, readline, regcmaybe, regcreset, regcomp, substcont, chop, schop, defined, undef, study, preinc, i_preinc, predec, i_predec, postinc, i_postinc, postdec, i_postdec, negate, i_negate, not, complement, ucfirst, lcfirst, uc, lc, quotemeta, aeach, avalues, each, pop, shift, grepstart, mapstart, mapwhile, range, and, or, dor, andassign, orassign, dorassign, argcheck, argdefelem, method, method_named, method_super, method_redir, method_redir_super, entergiven, leavegiven, enterwhen, leavewhen, untie, tied, dbmclose, getsockname, getpeername, lstat, stat, readlink, readdir, telldir, rewinddir, closedir, localtime, alarm, require, dofile, entertry, ghbyname, gnbyname, gpbyname, shostent, snetent, sprotoent, sservent, gpwnam, gpwuid, ggrnam, ggrgid, lock, once, fc, anonconst, cmpchain_and, cmpchain_dup, entertrycatch, catch */ 0x2fdc, 0x41b9, /* pushmark */ 0x00bd, /* wantarray, runcv */ 0x0438, 0x1a50, 0x426c, 0x3d28, 0x3505, /* const */ @@ -3352,6 +3370,9 @@ EXTCONST U8 PL_op_private_valid[] = { /* ISA */ (OPpARG2_MASK), /* CMPCHAIN_AND */ (OPpARG1_MASK), /* CMPCHAIN_DUP */ (OPpARG1_MASK), + /* ENTERTRYCATCH */ (OPpARG1_MASK), + /* LEAVETRYCATCH */ (0), + /* POPTRY */ (0), /* CATCH */ (OPpARG1_MASK), }; -- cgit v1.2.1