diff options
author | syber <syber@crazypanda.ru> | 2014-09-04 22:08:59 +0400 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-10-03 13:40:54 +0100 |
commit | b46e009d94293e069270690750f6c669c6d0ce22 (patch) | |
tree | c335154dccea12b391db6aaf7cac73db22e08f43 /perly.tab | |
parent | df968918245d10232f955ab0965da7f8d6297a29 (diff) | |
download | perl-b46e009d94293e069270690750f6c669c6d0ce22.tar.gz |
Make OP_METHOD* to be of new class METHOP
Introduce a new opcode class, METHOP, which will hold class/method related
info needed at runtime to improve performance of class/object method
calls, then change OP_METHOD and OP_METHOD_NAMED from being UNOP/SVOP to
being METHOP.
Note that because OP_METHOD is a UNOP with an op_first, while
OP_METHOD_NAMED is an SVOP, the first field of the METHOP structure
is a union holding either op_first or op_sv. This was seen as less messy
than having to introduce two new op classes.
The new op class's character is '.'
Nothing has changed in functionality and/or performance by this commit.
It just introduces new structure which will be extended with extra
fields and used in later commits.
Added METHOP constructors:
- newMETHOP() for method ops with dynamic method names.
The only optype for this op is OP_METHOD.
- newMETHOP_named() for method ops with constant method names.
Optypes for this op are: OP_METHOD_NAMED (currently) and (later)
OP_METHOD_SUPER, OP_METHOD_REDIR, OP_METHOD_NEXT, OP_METHOD_NEXTCAN,
OP_METHOD_MAYBENEXT
(This commit includes fixups by davem)
Diffstat (limited to 'perly.tab')
-rw-r--r-- | perly.tab | 29 |
1 files changed, 17 insertions, 12 deletions
@@ -215,7 +215,7 @@ static const yytype_uint16 yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -234,10 +234,10 @@ static const char *const yytname[] = "ANDOP", "NOTOP", "','", "ASSIGNOP", "'?'", "':'", "DORDOR", "OROR", "ANDAND", "BITOROP", "BITANDOP", "SHIFTOP", "MATCHOP", "'!'", "'~'", "REFGEN", "UMINUS", "POWOP", "POSTJOIN", "POSTDEC", "POSTINC", "PREDEC", - "PREINC", "ARROW", "')'", "'('", "$accept", "grammar", "@1", "@2", "@3", - "@4", "@5", "@6", "block", "formblock", "remember", "mblock", + "PREINC", "ARROW", "')'", "'('", "$accept", "grammar", "$@1", "$@2", + "$@3", "$@4", "$@5", "$@6", "block", "formblock", "remember", "mblock", "mremember", "stmtseq", "formstmtseq", "fullstmt", "labfullstmt", - "barestmt", "@7", "@8", "@9", "@10", "@11", "formline", "formarg", + "barestmt", "$@7", "$@8", "$@9", "$@10", "$@11", "formline", "formarg", "sideff", "else", "cont", "mintro", "nexpr", "texpr", "iexpr", "mexpr", "mnexpr", "miexpr", "formname", "startsub", "startanonsub", "startformsub", "subname", "proto", "subattrlist", "myattrlist", @@ -245,7 +245,7 @@ static const char *const yytname[] = "listop", "@13", "method", "subscripted", "termbinop", "termunop", "anonymous", "termdo", "term", "@14", "myattrterm", "myterm", "optlistexpr", "optexpr", "my_scalar", "amper", "scalar", "ary", "hsh", - "arylen", "star", "sliceme", "kvslice", "gelem", "indirob", 0 + "arylen", "star", "sliceme", "kvslice", "gelem", "indirob", YY_NULL }; #endif @@ -328,8 +328,8 @@ static const yytype_uint8 yyr2[] = 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -466,8 +466,7 @@ static const yytype_int16 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -238 static const yytype_int16 yytable[] = { @@ -750,6 +749,12 @@ static const yytype_int16 yytable[] = 183, 0, 0, 184 }; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-409))) + +#define yytable_value_is_error(Yytable_value) \ + (!!((Yytable_value) == (-238))) + static const yytype_int16 yycheck[] = { 10, 11, 12, 15, 128, 299, 9, 117, 396, 42, @@ -1106,8 +1111,8 @@ static const toketypes yy_type_tab[] = toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, - toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, - toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_ival, toketype_opval, + toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, + toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, @@ -1121,6 +1126,6 @@ static const toketypes yy_type_tab[] = }; /* Generated from: - * 39b6174c4729deec2a6ee4698d7dcd6496acb0a8f063daf726d1f853d4dcb54e perly.y + * 3a61f8d977f9bf0c587556e88cbbdbb0e347178ba03f85de232e25817751ee3c perly.y * d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl * ex: set ro: */ |