[svn:parrot] r48910 - in branches/oplib_handling_cleanup: compilers/imcc config/gen/config_h include/parrot src src/pmc src/runcore
plobsing at svn.parrot.org
plobsing at svn.parrot.org
Fri Sep 10 18:01:51 UTC 2010
Author: plobsing
Date: Fri Sep 10 18:01:50 2010
New Revision: 48910
URL: https://trac.parrot.org/parrot/changeset/48910
Log:
eliminate now inappropriate uses of core_ops->op_code in favour of interp->op_hash
Modified:
branches/oplib_handling_cleanup/compilers/imcc/cfg.c
branches/oplib_handling_cleanup/compilers/imcc/debug.c
branches/oplib_handling_cleanup/compilers/imcc/imc.h
branches/oplib_handling_cleanup/compilers/imcc/imcparser.c
branches/oplib_handling_cleanup/compilers/imcc/imcparser.h
branches/oplib_handling_cleanup/compilers/imcc/instructions.c
branches/oplib_handling_cleanup/compilers/imcc/instructions.h
branches/oplib_handling_cleanup/compilers/imcc/optimizer.c
branches/oplib_handling_cleanup/compilers/imcc/parser_util.c
branches/oplib_handling_cleanup/compilers/imcc/pbc.c
branches/oplib_handling_cleanup/compilers/imcc/pcc.c
branches/oplib_handling_cleanup/config/gen/config_h/config_h.in
branches/oplib_handling_cleanup/include/parrot/op.h
branches/oplib_handling_cleanup/include/parrot/oplib.h
branches/oplib_handling_cleanup/src/embed.c
branches/oplib_handling_cleanup/src/pmc/oplib.pmc
branches/oplib_handling_cleanup/src/runcore/main.c
Modified: branches/oplib_handling_cleanup/compilers/imcc/cfg.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/cfg.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/cfg.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -29,6 +29,7 @@
#include <string.h>
#include "imc.h"
#include "optimizer.h"
+#include "parrot/oplib/core_ops.h"
/* HEADERIZER HFILE: compilers/imcc/cfg.h */
@@ -276,7 +277,7 @@
ins->index = ++i;
ins->bbindex = unit->n_basic_blocks - 1;
- if (ins->opnum == -1 && (ins->type & ITPCCSUB)) {
+ if (!ins->op && (ins->type & ITPCCSUB)) {
if (first) {
if (ins->type & ITLABEL) {
expand_pcc_sub_ret(interp, unit, ins);
@@ -347,9 +348,10 @@
{
ASSERT_ARGS(bb_check_set_addr)
const Instruction *ins;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
for (ins = unit->instructions; ins; ins = ins->next) {
- if ((ins->opnum == PARROT_OP_set_addr_p_ic)
+ if ((ins->op == &core_ops->op_info_table[PARROT_OP_set_addr_p_ic])
&& STREQ(label->name, ins->symregs[1]->name)) {
IMCC_debug(interp, DEBUG_CFG, "set_addr %s\n",
ins->symregs[1]->name);
Modified: branches/oplib_handling_cleanup/compilers/imcc/debug.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/debug.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/debug.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -202,7 +202,7 @@
Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
"%4i %4d %4d %4d\t%x\t%8x %4d %4d %4d ",
ins->index, ins->line, bb->index, bb->loop_depth,
- ins->flags, ins->type, ins->opnum,
+ ins->flags, ins->type, OP_INFO_OPNUM(ins->op),
ins->opsize, pc);
}
else {
Modified: branches/oplib_handling_cleanup/compilers/imcc/imc.h
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/imc.h Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/imc.h Fri Sep 10 18:01:50 2010 (r48910)
@@ -196,8 +196,8 @@
__attribute__nonnull__(3)
FUNC_MODIFIES(*error_message);
-PARROT_WARN_UNUSED_RESULT
-int check_op(PARROT_INTERP,
+void check_op(PARROT_INTERP,
+ ARGOUT(op_info_t **op_info),
ARGOUT(char *fullname),
ARGIN(const char *name),
ARGIN(SymReg * const * r),
@@ -207,6 +207,8 @@
__attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
+ __attribute__nonnull__(5)
+ FUNC_MODIFIES(*op_info)
FUNC_MODIFIES(*fullname);
PARROT_WARN_UNUSED_RESULT
@@ -317,7 +319,7 @@
__attribute__nonnull__(1);
PARROT_WARN_UNUSED_RESULT
-int try_find_op(PARROT_INTERP,
+op_info_t * try_find_op(PARROT_INTERP,
ARGMOD(IMC_Unit *unit),
ARGIN(const char *name),
ARGMOD(SymReg **r),
@@ -337,6 +339,7 @@
, PARROT_ASSERT_ARG(error_message))
#define ASSERT_ARGS_check_op __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
+ , PARROT_ASSERT_ARG(op_info) \
, PARROT_ASSERT_ARG(fullname) \
, PARROT_ASSERT_ARG(name) \
, PARROT_ASSERT_ARG(r))
Modified: branches/oplib_handling_cleanup/compilers/imcc/imcparser.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/imcparser.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/imcparser.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -9,13 +9,12 @@
*/
/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -57,7 +56,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.4.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -1151,7 +1150,7 @@
/* Line 189 of yacc.c */
-#line 1144 "compilers/imcc/imcparser.c"
+#line 1143 "compilers/imcc/imcparser.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -1435,7 +1434,7 @@
/* Line 214 of yacc.c */
-#line 1428 "compilers/imcc/imcparser.c"
+#line 1427 "compilers/imcc/imcparser.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -1447,7 +1446,7 @@
/* Line 264 of yacc.c */
-#line 1440 "compilers/imcc/imcparser.c"
+#line 1439 "compilers/imcc/imcparser.c"
#ifdef short
# undef short
@@ -1497,7 +1496,7 @@
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -2444,9 +2443,18 @@
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+ Once GCC version 2 has supplanted version 1, this can go. However,
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+ discussed. */
#define YYFAIL goto yyerrlab
+#if defined YYFAIL
+ /* This is here to suppress warnings from the GCC cpp's
+ -Wunused-macros. Normally we don't worry about that warning, but
+ some users do, and we want to make it easy for users to remove
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
+#endif
#define YYRECOVERING() (!!yyerrstatus)
@@ -2503,7 +2511,7 @@
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -3254,28 +3262,28 @@
{
case 2:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1166 "compilers/imcc/imcc.y"
{ if (yynerrs) YYABORT; (yyval.i) = 0; }
break;
case 5:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1175 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 6:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1176 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 7:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1178 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
@@ -3286,7 +3294,7 @@
case 8:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1184 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
@@ -3297,42 +3305,42 @@
case 9:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1189 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 10:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1190 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 11:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1191 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 12:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1192 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 13:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1196 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 14:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1198 "compilers/imcc/imcc.y"
{
(yyval.i) = 0;
@@ -3343,7 +3351,7 @@
case 15:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1207 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->line = atoi((yyvsp[(2) - (5)].s));
@@ -3354,7 +3362,7 @@
case 16:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1213 "compilers/imcc/imcc.y"
{
/* set_filename() frees the STRINGC */
@@ -3364,7 +3372,7 @@
case 17:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1221 "compilers/imcc/imcc.y"
{
/* We'll want to store an entry while emitting instructions, so just
@@ -3377,7 +3385,7 @@
case 18:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1233 "compilers/imcc/imcc.y"
{
STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
@@ -3392,14 +3400,14 @@
case 19:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1245 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 20:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1246 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
@@ -3410,14 +3418,14 @@
case 21:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1254 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 22:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1255 "compilers/imcc/imcc.y"
{
(yyval.i) = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
@@ -3428,14 +3436,14 @@
case 23:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1261 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 24:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1262 "compilers/imcc/imcc.y"
{
(yyval.i) = mk_pmc_const_named(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
@@ -3447,49 +3455,49 @@
case 29:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1280 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 30:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1281 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 31:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1282 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 32:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1283 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 33:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1284 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 36:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1289 "compilers/imcc/imcc.y"
{ clear_state(interp); }
break;
case 37:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1291 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp, IMCC_INFO(interp)->cur_unit,
@@ -3501,7 +3509,7 @@
case 38:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1298 "compilers/imcc/imcc.y"
{
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3511,7 +3519,7 @@
case 39:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1303 "compilers/imcc/imcc.y"
{
(yyval.i) = iSUBROUTINE(interp,
@@ -3524,7 +3532,7 @@
case 40:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1311 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr));
@@ -3533,7 +3541,7 @@
case 41:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1315 "compilers/imcc/imcc.y"
{
char *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1);
@@ -3551,21 +3559,21 @@
case 42:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1327 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;}
break;
case 44:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1335 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); }
break;
case 45:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1338 "compilers/imcc/imcc.y"
{
/* if (optimizer_level & OPT_PASM)
@@ -3578,7 +3586,7 @@
case 48:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1354 "compilers/imcc/imcc.y"
{
int re_open = 0;
@@ -3595,21 +3603,21 @@
case 49:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1368 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); }
break;
case 50:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1369 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; }
break;
case 51:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1373 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
@@ -3618,7 +3626,7 @@
case 52:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1377 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
@@ -3629,14 +3637,14 @@
case 53:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1385 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); }
break;
case 54:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1387 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
@@ -3646,7 +3654,7 @@
case 55:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1395 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB);
@@ -3655,7 +3663,7 @@
case 56:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1399 "compilers/imcc/imcc.y"
{
iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr));
@@ -3664,7 +3672,7 @@
case 57:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1403 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(5) - (6)].t);
@@ -3677,28 +3685,28 @@
case 58:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1411 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 59:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1415 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 60:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1416 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 61:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1418 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -3713,21 +3721,21 @@
case 62:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1430 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 63:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1430 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(3) - (3)].sr); IMCC_INFO(interp)->is_def = 0; }
break;
case 64:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1435 "compilers/imcc/imcc.y"
{
if ((yyvsp[(3) - (3)].t) & VT_OPT_FLAG && (yyvsp[(1) - (3)].t) != 'I') {
@@ -3752,14 +3760,14 @@
case 65:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1459 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 66:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1464 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3770,7 +3778,7 @@
case 67:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1470 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3781,7 +3789,7 @@
case 68:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1479 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
@@ -3792,7 +3800,7 @@
case 69:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1485 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
@@ -3803,7 +3811,7 @@
case 70:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1494 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
@@ -3814,7 +3822,7 @@
case 71:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1500 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
@@ -3825,7 +3833,7 @@
case 72:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1509 "compilers/imcc/imcc.y"
{
(yyval.t) = P_NSENTRY;
@@ -3836,7 +3844,7 @@
case 73:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1515 "compilers/imcc/imcc.y"
{
(yyval.t) = P_NSENTRY;
@@ -3847,7 +3855,7 @@
case 74:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1524 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3857,7 +3865,7 @@
case 75:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1532 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3867,7 +3875,7 @@
case 76:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1537 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3879,7 +3887,7 @@
case 77:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1547 "compilers/imcc/imcc.y"
{
add_pcc_multi(interp, IMCC_INFO(interp)->cur_call, NULL);
@@ -3888,7 +3896,7 @@
case 78:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1551 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3898,7 +3906,7 @@
case 79:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1556 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3908,35 +3916,35 @@
case 80:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1563 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "INTVAL", 'S'); }
break;
case 81:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1564 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); }
break;
case 82:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1565 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "PMC", 'S'); }
break;
case 83:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1566 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "STRING", 'S'); }
break;
case 84:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1568 "compilers/imcc/imcc.y"
{
SymReg *r;
@@ -3952,7 +3960,7 @@
case 85:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1579 "compilers/imcc/imcc.y"
{
SymReg *r;
@@ -3968,14 +3976,14 @@
case 86:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1589 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); }
break;
case 89:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1599 "compilers/imcc/imcc.y"
{
char name[128];
@@ -4002,112 +4010,112 @@
case 90:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1625 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 91:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1629 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; }
break;
case 92:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1630 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; }
break;
case 93:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1634 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; }
break;
case 94:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1635 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); }
break;
case 95:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1639 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 97:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1644 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (1)].t); }
break;
case 98:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1645 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 99:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1649 "compilers/imcc/imcc.y"
{ (yyval.t) = P_LOAD; }
break;
case 100:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1650 "compilers/imcc/imcc.y"
{ (yyval.t) = P_INIT; }
break;
case 101:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1651 "compilers/imcc/imcc.y"
{ (yyval.t) = P_MAIN; }
break;
case 102:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1652 "compilers/imcc/imcc.y"
{ (yyval.t) = P_IMMEDIATE; }
break;
case 103:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1653 "compilers/imcc/imcc.y"
{ (yyval.t) = P_POSTCOMP; }
break;
case 104:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1654 "compilers/imcc/imcc.y"
{ (yyval.t) = P_ANON; }
break;
case 105:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1655 "compilers/imcc/imcc.y"
{ (yyval.t) = P_NEED_LEX; }
break;
case 113:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1667 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
@@ -4117,7 +4125,7 @@
case 114:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1672 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -4126,7 +4134,7 @@
case 115:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1676 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -4135,7 +4143,7 @@
case 116:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1680 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -4144,7 +4152,7 @@
case 117:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1684 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (3)].s), 'S'));
@@ -4153,7 +4161,7 @@
case 118:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1688 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
@@ -4163,7 +4171,7 @@
case 119:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1693 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (5)].s), 'S'));
@@ -4173,14 +4181,14 @@
case 120:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1701 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 121:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1702 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4195,21 +4203,21 @@
case 122:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1714 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (2)].sr); }
break;
case 123:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1719 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 124:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1721 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
@@ -4219,21 +4227,21 @@
case 125:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1728 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 126:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1729 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 127:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1730 "compilers/imcc/imcc.y"
{
IdList * const l = (yyvsp[(4) - (4)].idlist);
@@ -4247,91 +4255,91 @@
case 128:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1741 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 129:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1742 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 130:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1746 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; }
break;
case 131:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1747 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPTIONAL; }
break;
case 132:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1748 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPT_FLAG; }
break;
case 133:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1749 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; }
break;
case 134:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1750 "compilers/imcc/imcc.y"
{ adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = VT_NAMED; mem_sys_free((yyvsp[(3) - (4)].s)); }
break;
case 135:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1751 "compilers/imcc/imcc.y"
{ adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = VT_NAMED; mem_sys_free((yyvsp[(3) - (4)].s)); }
break;
case 136:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1752 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 137:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1753 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_CALL_SIG; }
break;
case 138:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1758 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 0); }
break;
case 139:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1760 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 140:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1762 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
@@ -4341,28 +4349,28 @@
case 141:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1769 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 1); }
break;
case 142:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1771 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 143:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1775 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 144:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1777 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
@@ -4372,7 +4380,7 @@
case 145:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1782 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
@@ -4382,14 +4390,14 @@
case 146:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1789 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 147:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1791 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
@@ -4399,7 +4407,7 @@
case 148:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1796 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
@@ -4409,21 +4417,21 @@
case 149:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1803 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 150:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1807 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 151:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1812 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->asm_state == AsmDefault)
@@ -4433,7 +4441,7 @@
case 152:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1817 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
@@ -4443,28 +4451,28 @@
case 153:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1824 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 154:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1825 "compilers/imcc/imcc.y"
{ (yyval.t) = 1; }
break;
case 155:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1829 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 156:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1831 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4479,7 +4487,7 @@
case 157:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1841 "compilers/imcc/imcc.y"
{
SymReg * const name = mk_const(interp, (yyvsp[(1) - (3)].s), 'S');
@@ -4489,7 +4497,7 @@
case 158:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1846 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4504,7 +4512,7 @@
case 159:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1856 "compilers/imcc/imcc.y"
{
SymReg * const name = mk_const(interp, (yyvsp[(3) - (5)].s), 'S');
@@ -4514,63 +4522,63 @@
case 162:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1877 "compilers/imcc/imcc.y"
{ clear_state(interp); }
break;
case 163:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1882 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (2)].i); }
break;
case 164:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1883 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 165:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1884 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 166:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1885 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 167:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1886 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 168:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1887 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 169:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1891 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; }
break;
case 173:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1902 "compilers/imcc/imcc.y"
{
Instruction * const i = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s)));
@@ -4581,14 +4589,14 @@
case 174:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1912 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (3)].i); }
break;
case 175:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1914 "compilers/imcc/imcc.y"
{
if (yynerrs >= PARROT_MAX_RECOVER_ERRORS) {
@@ -4601,7 +4609,7 @@
case 176:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1925 "compilers/imcc/imcc.y"
{
IdList* const l = (yyvsp[(1) - (1)].idlist);
@@ -4612,7 +4620,7 @@
case 177:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1932 "compilers/imcc/imcc.y"
{
IdList* const l = (yyvsp[(3) - (3)].idlist);
@@ -4623,7 +4631,7 @@
case 178:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1941 "compilers/imcc/imcc.y"
{
IdList* const l = mem_gc_allocate_n_zeroed_typed(interp, 1, IdList);
@@ -4634,14 +4642,14 @@
case 183:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1957 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 184:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1958 "compilers/imcc/imcc.y"
{
IdList *l = (yyvsp[(4) - (4)].idlist);
@@ -4659,7 +4667,7 @@
case 185:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1971 "compilers/imcc/imcc.y"
{
if ((yyvsp[(4) - (4)].sr)->set != 'P') {
@@ -4681,7 +4689,7 @@
case 186:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 1988 "compilers/imcc/imcc.y"
{
if ((yyvsp[(4) - (4)].sr)->set != 'P') {
@@ -4699,14 +4707,14 @@
case 187:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2000 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 188:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2001 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0);
@@ -4717,14 +4725,14 @@
case 190:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2008 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 191:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2009 "compilers/imcc/imcc.y"
{
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
@@ -4735,7 +4743,7 @@
case 192:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2015 "compilers/imcc/imcc.y"
{
(yyval.i) = NULL;
@@ -4746,7 +4754,7 @@
case 193:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2021 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr));
@@ -4755,7 +4763,7 @@
case 194:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2025 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp,
@@ -4772,98 +4780,98 @@
case 195:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2036 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); }
break;
case 196:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2037 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 197:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2038 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 200:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2041 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;}
break;
case 201:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2045 "compilers/imcc/imcc.y"
{ (yyval.t) = 'I'; }
break;
case 202:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2046 "compilers/imcc/imcc.y"
{ (yyval.t) = 'N'; }
break;
case 203:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2047 "compilers/imcc/imcc.y"
{ (yyval.t) = 'S'; }
break;
case 204:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2048 "compilers/imcc/imcc.y"
{ (yyval.t) = 'P'; }
break;
case 205:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2053 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); }
break;
case 206:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2055 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (4)].s), 2, (yyvsp[(1) - (4)].sr), (yyvsp[(4) - (4)].sr)); }
break;
case 207:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2057 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(4) - (5)].s), 3, (yyvsp[(1) - (5)].sr), (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr)); }
break;
case 208:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2059 "compilers/imcc/imcc.y"
{ (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); }
break;
case 209:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2061 "compilers/imcc/imcc.y"
{ (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); }
break;
case 210:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2064 "compilers/imcc/imcc.y"
{
add_pcc_result(interp, (yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr));
@@ -4874,7 +4882,7 @@
case 211:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2070 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
@@ -4883,7 +4891,7 @@
case 212:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2074 "compilers/imcc/imcc.y"
{
IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr));
@@ -4893,7 +4901,7 @@
case 216:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2082 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr));
@@ -4902,189 +4910,189 @@
case 217:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2089 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"not"; }
break;
case 218:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2090 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bnot"; }
break;
case 219:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2091 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"neg"; }
break;
case 220:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2095 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; }
break;
case 221:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2096 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; }
break;
case 222:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2097 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; }
break;
case 223:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2098 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; }
break;
case 224:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2099 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; }
break;
case 225:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2100 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; }
break;
case 226:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2101 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"pow"; }
break;
case 227:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2102 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; }
break;
case 228:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2103 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"iseq"; }
break;
case 229:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2104 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isne"; }
break;
case 230:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2105 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isgt"; }
break;
case 231:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2106 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isge"; }
break;
case 232:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2107 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"islt"; }
break;
case 233:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2108 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isle"; }
break;
case 234:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2109 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; }
break;
case 235:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2110 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; }
break;
case 236:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2111 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; }
break;
case 237:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2112 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"and"; }
break;
case 238:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2113 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"or"; }
break;
case 239:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2114 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"xor"; }
break;
case 240:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2115 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; }
break;
case 241:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2116 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; }
break;
case 242:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2117 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; }
break;
case 243:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2123 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
@@ -5095,112 +5103,112 @@
case 244:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2128 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 245:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2135 "compilers/imcc/imcc.y"
{ (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(2) - (3)].s), 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); }
break;
case 246:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2139 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; }
break;
case 247:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2140 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; }
break;
case 248:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2141 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; }
break;
case 249:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2142 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; }
break;
case 250:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2143 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; }
break;
case 251:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2144 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; }
break;
case 252:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2145 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; }
break;
case 253:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2146 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; }
break;
case 254:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2147 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; }
break;
case 255:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2148 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; }
break;
case 256:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2149 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; }
break;
case 257:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2150 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; }
break;
case 258:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2151 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; }
break;
case 259:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2157 "compilers/imcc/imcc.y"
{
(yyval.i) = func_ins(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (4)].sr), (yyvsp[(3) - (4)].s),
@@ -5213,28 +5221,28 @@
case 260:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2167 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 261:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2168 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 262:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2169 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 263:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2171 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(1) - (1)].sr);
@@ -5245,7 +5253,7 @@
case 264:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2177 "compilers/imcc/imcc.y"
{
/* disallow bareword method names; SREG name constants are fine */
@@ -5264,7 +5272,7 @@
case 265:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2191 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
@@ -5275,7 +5283,7 @@
case 266:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2197 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
@@ -5286,14 +5294,14 @@
case 267:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2202 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); }
break;
case 268:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2208 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
@@ -5303,21 +5311,21 @@
case 269:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2212 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (5)].i); }
break;
case 270:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2216 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 271:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2218 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5332,7 +5340,7 @@
case 272:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2228 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5347,7 +5355,7 @@
case 273:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2238 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5359,7 +5367,7 @@
case 274:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2245 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5369,7 +5377,7 @@
case 275:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2250 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5381,70 +5389,70 @@
case 276:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2259 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
break;
case 277:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2263 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 278:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2264 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 279:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2268 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; }
break;
case 280:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2269 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; }
break;
case 281:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2270 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_CALL_SIG; }
break;
case 282:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2272 "compilers/imcc/imcc.y"
{ adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); mem_sys_free((yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
case 283:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2273 "compilers/imcc/imcc.y"
{ adv_named_set(interp, (yyvsp[(3) - (4)].s)); mem_sys_free((yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
case 284:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2277 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
break;
case 285:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2282 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5459,7 +5467,7 @@
case 286:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2292 "compilers/imcc/imcc.y"
{
add_pcc_named_result(interp, IMCC_INFO(interp)->cur_call,
@@ -5470,7 +5478,7 @@
case 287:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2298 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5485,7 +5493,7 @@
case 288:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2308 "compilers/imcc/imcc.y"
{
add_pcc_named_result(interp, IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr));
@@ -5495,28 +5503,28 @@
case 289:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2312 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 290:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2316 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 291:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2317 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 292:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2322 "compilers/imcc/imcc.y"
{
(yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, inv_op((yyvsp[(3) - (6)].s)), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
@@ -5525,7 +5533,7 @@
case 293:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2326 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
@@ -5534,7 +5542,7 @@
case 294:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2330 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
@@ -5543,7 +5551,7 @@
case 295:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2337 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
@@ -5552,7 +5560,7 @@
case 296:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2341 "compilers/imcc/imcc.y"
{
(yyval.i) =MK_I(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), 3, (yyvsp[(2) - (6)].sr), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].sr));
@@ -5561,7 +5569,7 @@
case 297:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2345 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if_null", 2, (yyvsp[(3) - (5)].sr), (yyvsp[(5) - (5)].sr));
@@ -5570,91 +5578,91 @@
case 298:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2351 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 299:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2352 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 300:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2356 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"eq"; }
break;
case 301:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2357 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ne"; }
break;
case 302:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2358 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"gt"; }
break;
case 303:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2359 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ge"; }
break;
case 304:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2360 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lt"; }
break;
case 305:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2361 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"le"; }
break;
case 308:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2370 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; }
break;
case 309:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2371 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (1)].sr); }
break;
case 310:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2375 "compilers/imcc/imcc.y"
{ (yyval.sr) = IMCC_INFO(interp)->regs[0]; }
break;
case 312:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2380 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); }
break;
case 313:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2382 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (4)].sr);
@@ -5666,7 +5674,7 @@
case 314:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2389 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr);
@@ -5676,49 +5684,49 @@
case 316:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2396 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 317:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2397 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 318:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2401 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 319:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2402 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 320:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2406 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 321:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2407 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 326:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2421 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
@@ -5727,7 +5735,7 @@
case 327:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2425 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
@@ -5738,7 +5746,7 @@
case 328:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2433 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
@@ -5747,7 +5755,7 @@
case 329:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2437 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
@@ -5758,14 +5766,14 @@
case 330:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2445 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); }
break;
case 331:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2447 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
@@ -5775,7 +5783,7 @@
case 332:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2455 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(1) - (1)].sr);
@@ -5784,78 +5792,78 @@
case 333:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2461 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); }
break;
case 334:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2462 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); }
break;
case 335:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2463 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); }
break;
case 336:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2464 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); }
break;
case 337:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2465 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 338:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2469 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 339:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2470 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 340:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2474 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 341:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2475 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 342:
-/* Line 1455 of yacc.c */
+/* Line 1464 of yacc.c */
#line 2476 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (1)].sr); }
break;
-/* Line 1455 of yacc.c */
-#line 5848 "compilers/imcc/imcparser.c"
+/* Line 1464 of yacc.c */
+#line 5856 "compilers/imcc/imcparser.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -6066,7 +6074,7 @@
-/* Line 1675 of yacc.c */
+/* Line 1684 of yacc.c */
#line 2482 "compilers/imcc/imcc.y"
Modified: branches/oplib_handling_cleanup/compilers/imcc/imcparser.h
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/imcparser.h Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/imcparser.h Fri Sep 10 18:01:50 2010 (r48910)
@@ -9,13 +9,12 @@
*/
/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.4.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -295,7 +294,7 @@
typedef union YYSTYPE
{
-/* Line 1676 of yacc.c */
+/* Line 1685 of yacc.c */
#line 1071 "compilers/imcc/imcc.y"
IdList * idlist;
@@ -306,8 +305,8 @@
-/* Line 1676 of yacc.c */
-#line 300 "compilers/imcc/imcparser.h"
+/* Line 1685 of yacc.c */
+#line 299 "compilers/imcc/imcparser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
Modified: branches/oplib_handling_cleanup/compilers/imcc/instructions.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/instructions.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/instructions.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -10,6 +10,7 @@
#include "pbc.h"
#include "optimizer.h"
#include "pmc/pmc_callcontext.h"
+#include "parrot/oplib/core_ops.h"
/*
@@ -112,7 +113,7 @@
ins->symregs[i] = r[i];
ins->flags = flags;
- ins->opnum = -1;
+ ins->op = NULL;
return ins;
}
@@ -133,19 +134,22 @@
{
ASSERT_ARGS(instruction_reads)
int f, i;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(NULL);
- if (ins->opnum == PARROT_OP_set_args_pc
- || ins->opnum == PARROT_OP_set_returns_pc) {
+ if (ins->op && ins->op->lib == core_ops) {
+ if (OP_INFO_OPNUM(ins->op) == PARROT_OP_set_args_pc
+ || OP_INFO_OPNUM(ins->op) == PARROT_OP_set_returns_pc) {
+
+ for (i = ins->symreg_count - 1; i >= 0; --i)
+ if (r == ins->symregs[i])
+ return 1;
- for (i = ins->symreg_count - 1; i >= 0; --i)
- if (r == ins->symregs[i])
- return 1;
-
- return 0;
- }
- else if (ins->opnum == PARROT_OP_get_params_pc ||
- ins->opnum == PARROT_OP_get_results_pc) {
- return 0;
+ return 0;
+ }
+ else if (OP_INFO_OPNUM(ins->op) == PARROT_OP_get_params_pc ||
+ OP_INFO_OPNUM(ins->op) == PARROT_OP_get_results_pc) {
+ return 0;
+ }
}
f = ins->flags;
@@ -172,7 +176,7 @@
/* a sub call reads the previous args */
if (ins->type & ITPCCSUB) {
- while (ins && ins->opnum != PARROT_OP_set_args_pc)
+ while (ins && ins->op != &core_ops->op_info_table[PARROT_OP_set_args_pc])
ins = ins->prev;
if (!ins)
@@ -204,9 +208,10 @@
ASSERT_ARGS(instruction_writes)
const int f = ins->flags;
int j;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(NULL);
/* a get_results opcode occurs after the actual sub call */
- if (ins->opnum == PARROT_OP_get_results_pc) {
+ if (ins->op == &core_ops->op_info_table[PARROT_OP_get_results_pc]) {
int i;
/* but only if it isn't the get_results opcode of
@@ -231,7 +236,7 @@
* and point to the most recent pcc_sub
* structure
*/
- while (ins && ins->opnum != PARROT_OP_get_results_pc)
+ while (ins && ins->op != &core_ops->op_info_table[PARROT_OP_get_results_pc])
ins = ins->next;
if (!ins)
@@ -245,7 +250,7 @@
return 0;
}
- if (ins->opnum == PARROT_OP_get_params_pc) {
+ if (ins->op == &core_ops->op_info_table[PARROT_OP_get_params_pc]) {
int i;
for (i = ins->symreg_count - 1; i >= 0; --i) {
@@ -255,8 +260,8 @@
return 0;
}
- else if (ins->opnum == PARROT_OP_set_args_pc
- || ins->opnum == PARROT_OP_set_returns_pc) {
+ else if (ins->op == &core_ops->op_info_table[PARROT_OP_set_args_pc]
+ || ins->op == &core_ops->op_info_table[PARROT_OP_set_returns_pc]) {
return 0;
}
Modified: branches/oplib_handling_cleanup/compilers/imcc/instructions.h
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/instructions.h Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/instructions.h Fri Sep 10 18:01:50 2010 (r48910)
@@ -34,7 +34,7 @@
struct _Instruction *prev;
struct _Instruction *next;
- int opnum; /* parrot op number */
+ op_info_t *op; /* parrot opcode */
int opsize; /* parrot op size */
int line; /* source code line number */
int symreg_count; /* count of regs in **symregs */
Modified: branches/oplib_handling_cleanup/compilers/imcc/optimizer.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/optimizer.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/optimizer.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -74,6 +74,7 @@
#include "pbc.h"
#include "optimizer.h"
#include "pmc/pmc_callcontext.h"
+#include "parrot/oplib/core_ops.h"
/* HEADERIZER HFILE: compilers/imcc/optimizer.h */
@@ -368,7 +369,7 @@
last->symregs[reg] = go;
tmp = INS(interp, unit, neg_op, "",
last->symregs, args, 0, 0);
- last->opnum = tmp->opnum;
+ last->op = tmp->op;
last->opsize = tmp->opsize;
mem_sys_free(last->opname);
last->opname = mem_sys_strdup(tmp->opname);
@@ -409,6 +410,7 @@
SymReg *r;
int changes = 0;
FLOATVAL f;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
IMCC_info(interp, 2, "\tstrength_reduce\n");
for (ins = unit->instructions; ins; ins = ins->next) {
@@ -428,37 +430,37 @@
* div Nx, Nx, Ny => sub Nx, Ny
* fdiv Nx, Nx, Ny => sub Nx, Ny
*/
- if (((ins->opnum == PARROT_OP_sub_i_i_i ||
- ins->opnum == PARROT_OP_sub_i_i_ic ||
- ins->opnum == PARROT_OP_sub_i_ic_i ||
- ins->opnum == PARROT_OP_div_i_i_i ||
- ins->opnum == PARROT_OP_div_i_i_ic ||
- ins->opnum == PARROT_OP_div_i_ic_i ||
- ins->opnum == PARROT_OP_fdiv_i_i_i ||
- ins->opnum == PARROT_OP_fdiv_i_i_ic ||
- ins->opnum == PARROT_OP_fdiv_i_ic_i ||
- ins->opnum == PARROT_OP_sub_n_n_n ||
- ins->opnum == PARROT_OP_sub_n_n_nc ||
- ins->opnum == PARROT_OP_sub_n_nc_n ||
- ins->opnum == PARROT_OP_div_n_n_n ||
- ins->opnum == PARROT_OP_div_n_n_nc ||
- ins->opnum == PARROT_OP_div_n_nc_n ||
- ins->opnum == PARROT_OP_fdiv_n_n_n ||
- ins->opnum == PARROT_OP_fdiv_n_n_nc ||
- ins->opnum == PARROT_OP_fdiv_n_nc_n) &&
+ if (((ins->op == &core_ops->op_info_table[PARROT_OP_sub_i_i_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_i_ic_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_i_i_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_i_ic_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_i_i_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_i_ic_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_n_n_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_n_nc_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_n_n_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_n_nc_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_n_n_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_n_nc_n]) &&
ins->symregs[0] == ins->symregs[1])
- || ((ins->opnum == PARROT_OP_add_i_i_i ||
- ins->opnum == PARROT_OP_add_i_i_ic ||
- ins->opnum == PARROT_OP_add_i_ic_i ||
- ins->opnum == PARROT_OP_mul_i_i_i ||
- ins->opnum == PARROT_OP_mul_i_i_ic ||
- ins->opnum == PARROT_OP_mul_i_ic_i ||
- ins->opnum == PARROT_OP_add_n_n_n ||
- ins->opnum == PARROT_OP_add_n_n_nc ||
- ins->opnum == PARROT_OP_add_n_nc_n ||
- ins->opnum == PARROT_OP_mul_n_n_n ||
- ins->opnum == PARROT_OP_mul_n_n_nc ||
- ins->opnum == PARROT_OP_mul_n_nc_n) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_add_i_i_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_add_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_add_i_ic_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_i_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_ic_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_add_n_n_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_add_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_add_n_nc_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_n_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_nc_n]) &&
(ins->symregs[0] == ins->symregs[1] ||
ins->symregs[0] == ins->symregs[2]))) {
IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
@@ -483,19 +485,19 @@
* div Nx, 1 => delete
* fdiv Nx, 1 => delete
*/
- if (((ins->opnum == PARROT_OP_add_i_ic ||
- ins->opnum == PARROT_OP_sub_i_ic) &&
+ if (((ins->op == &core_ops->op_info_table[PARROT_OP_add_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_i_ic]) &&
IMCC_int_from_reg(interp, ins->symregs[1]) == 0)
- || ((ins->opnum == PARROT_OP_mul_i_ic ||
- ins->opnum == PARROT_OP_div_i_ic ||
- ins->opnum == PARROT_OP_fdiv_i_ic) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_i_ic]) &&
IMCC_int_from_reg(interp, ins->symregs[1]) == 1)
- || ((ins->opnum == PARROT_OP_add_n_nc ||
- ins->opnum == PARROT_OP_sub_n_nc) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_add_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_n_nc]) &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)))
- || ((ins->opnum == PARROT_OP_mul_n_nc ||
- ins->opnum == PARROT_OP_div_n_nc ||
- ins->opnum == PARROT_OP_fdiv_n_nc) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_n_nc]) &&
atof(ins->symregs[1]->name) == 1.0)) {
IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
ins = delete_ins(unit, ins);
@@ -513,16 +515,16 @@
* sub Ix, 1 => dec Ix
* sub Nx, 1 => dec Nx
*/
- if (((ins->opnum == PARROT_OP_add_i_ic ||
- ins->opnum == PARROT_OP_sub_i_ic) &&
+ if (((ins->op == &core_ops->op_info_table[PARROT_OP_add_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_i_ic]) &&
IMCC_int_from_reg(interp, ins->symregs[1]) == 1)
- || ((ins->opnum == PARROT_OP_add_n_nc ||
- ins->opnum == PARROT_OP_sub_n_nc) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_add_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_n_nc]) &&
atof(ins->symregs[1]->name) == 1.0)) {
IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
--ins->symregs[1]->use_count;
- if (ins->opnum == PARROT_OP_add_i_ic ||
- ins->opnum == PARROT_OP_add_n_nc)
+ if (ins->op == &core_ops->op_info_table[PARROT_OP_add_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_add_n_nc])
tmp = INS(interp, unit, "inc", "", ins->symregs, 1, 0, 0);
else
tmp = INS(interp, unit, "dec", "", ins->symregs, 1, 0, 0);
@@ -548,27 +550,27 @@
* div Nx, Ny, 1 => set Nx, Ny
* fdiv Nx, Ny, 1 => set Nx, Ny
*/
- if (((ins->opnum == PARROT_OP_add_i_i_ic ||
- ins->opnum == PARROT_OP_sub_i_i_ic) &&
+ if (((ins->op == &core_ops->op_info_table[PARROT_OP_add_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_i_i_ic]) &&
IMCC_int_from_reg(interp, ins->symregs[2]) == 0)
- || (ins->opnum == PARROT_OP_add_i_ic_i &&
+ || (ins->op == &core_ops->op_info_table[PARROT_OP_add_i_ic_i] &&
IMCC_int_from_reg(interp, ins->symregs[1]) == 0)
- || ((ins->opnum == PARROT_OP_mul_i_i_ic ||
- ins->opnum == PARROT_OP_div_i_i_ic ||
- ins->opnum == PARROT_OP_fdiv_i_i_ic) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_i_i_ic] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_i_i_ic]) &&
IMCC_int_from_reg(interp, ins->symregs[2]) == 1)
- || (ins->opnum == PARROT_OP_mul_i_ic_i &&
+ || (ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_ic_i] &&
IMCC_int_from_reg(interp, ins->symregs[1]) == 1)
- || ((ins->opnum == PARROT_OP_add_n_n_nc ||
- ins->opnum == PARROT_OP_sub_n_n_nc) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_add_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_sub_n_n_nc]) &&
(f = atof(ins->symregs[2]->name), FLOAT_IS_ZERO(f)))
- || (ins->opnum == PARROT_OP_add_n_nc_n &&
+ || (ins->op == &core_ops->op_info_table[PARROT_OP_add_n_nc_n] &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)))
- || ((ins->opnum == PARROT_OP_mul_n_n_nc ||
- ins->opnum == PARROT_OP_div_n_n_nc ||
- ins->opnum == PARROT_OP_fdiv_n_n_nc) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_div_n_n_nc] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_fdiv_n_n_nc]) &&
atof(ins->symregs[2]->name) == 1.0)
- || (ins->opnum == PARROT_OP_mul_n_nc_n &&
+ || (ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_nc_n] &&
atof(ins->symregs[1]->name) == 1.0)) {
IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
if (ins->symregs[1]->type == VTCONST) {
@@ -590,15 +592,15 @@
* mul Ix, 0, Iy => set Ix, 0
* mul Ix, 0 => set Ix, 0
*/
- if ((ins->opnum == PARROT_OP_mul_i_i_ic &&
+ if ((ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_i_ic] &&
IMCC_int_from_reg(interp, ins->symregs[2]) == 0)
- || ((ins->opnum == PARROT_OP_mul_i_ic_i ||
- ins->opnum == PARROT_OP_mul_i_ic) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_ic_i] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_i_ic]) &&
IMCC_int_from_reg(interp, ins->symregs[1]) == 0)
- || (ins->opnum == PARROT_OP_mul_n_n_nc &&
+ || (ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_n_nc] &&
(f = atof(ins->symregs[2]->name), FLOAT_IS_ZERO(f)))
- || ((ins->opnum == PARROT_OP_mul_n_nc_n ||
- ins->opnum == PARROT_OP_mul_n_nc) &&
+ || ((ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_nc_n] ||
+ ins->op == &core_ops->op_info_table[PARROT_OP_mul_n_nc]) &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)))) {
IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
r = mk_const(interp, "0", ins->symregs[0]->set);
@@ -616,9 +618,9 @@
* set Ix, 0 => null Ix
* set Nx, 0 => null Nx
*/
- if ((ins->opnum == PARROT_OP_set_i_ic &&
+ if ((ins->op == &core_ops->op_info_table[PARROT_OP_set_i_ic] &&
IMCC_int_from_reg(interp, ins->symregs[1]) == 0)
- || (ins->opnum == PARROT_OP_set_n_nc &&
+ || (ins->op == &core_ops->op_info_table[PARROT_OP_set_n_nc] &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)) &&
ins->symregs[1]->name[0] != '-')) {
IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
@@ -714,16 +716,15 @@
}
else {
char fullname[128];
- const int op = check_op(interp, fullname, ins2->opname,
+ check_op(interp, &ins2->op, fullname, ins2->opname,
ins2->symregs, ins2->symreg_count, ins2->keys);
- if (op < 0) {
+ if (!ins2->op) {
ins2->symregs[i] = old;
IMCC_debug(interp, DEBUG_OPT2,
" - no %s\n", fullname);
}
else {
--old->use_count;
- ins2->opnum = op;
any = 1;
IMCC_debug(interp, DEBUG_OPT2,
" -> %d\n", ins2);
@@ -804,14 +805,11 @@
opcode_t eval[4], *pc;
int opnum;
int i;
- op_info_t *op_info;
-
- opnum = interp->op_lib->op_code(interp, op, 1);
- if (opnum < 0)
+ op_info_t *op_info = parrot_hash_get(interp, interp->op_hash, (void *)op);
+ if (!op_info || !STREQ(op_info->full_name, op))
IMCC_fatal(interp, 1, "eval_ins: op '%s' not found\n", op);
- op_info = interp->op_info_table + opnum;
/* now fill registers */
- eval[0] = opnum;
+ eval[0] = 0;
for (i = 0; i < op_info->op_count - 1; i++) {
switch (op_info->types[i]) {
case PARROT_ARG_IC:
@@ -855,7 +853,7 @@
if (setjmp(interp->current_runloop->resume))
return -1;
- pc = (interp->op_func_table[opnum]) (eval, interp);
+ pc = (OP_INFO_OPFUNC(op_info)) (eval, interp);
free_runloop_jump_point(interp);
/* the returned pc is either incremented by op_count or is eval,
* as the branch offset is 0 - return true if it branched
Modified: branches/oplib_handling_cleanup/compilers/imcc/parser_util.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/parser_util.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/parser_util.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -175,8 +175,8 @@
/*
-=item C<int check_op(PARROT_INTERP, char *fullname, const char *name, SymReg *
-const * r, int narg, int keyvec)>
+=item C<void check_op(PARROT_INTERP, op_info_t **op_info, char *fullname, const
+char *name, SymReg * const * r, int narg, int keyvec)>
Return opcode value for op name
@@ -184,15 +184,15 @@
*/
-PARROT_WARN_UNUSED_RESULT
-int
-check_op(PARROT_INTERP, ARGOUT(char *fullname), ARGIN(const char *name),
- ARGIN(SymReg * const * r), int narg, int keyvec)
+void
+check_op(PARROT_INTERP, ARGOUT(op_info_t **op_info), ARGOUT(char *fullname),
+ ARGIN(const char *name), ARGIN(SymReg * const * r), int narg, int keyvec)
{
ASSERT_ARGS(check_op)
op_fullname(fullname, name, r, narg, keyvec);
-
- return interp->op_lib->op_code(interp, fullname, 1);
+ *op_info = parrot_hash_get(interp, interp->op_hash, fullname);
+ if (*op_info && !STREQ((*op_info)->full_name, fullname))
+ *op_info = NULL;
}
/*
@@ -210,8 +210,7 @@
is_op(PARROT_INTERP, ARGIN(const char *name))
{
ASSERT_ARGS(is_op)
- return interp->op_lib->op_code(interp, name, 0) >= 0
- || interp->op_lib->op_code(interp, name, 1) >= 0;
+ return parrot_hash_exists(interp, interp->op_hash, (void *)name);
}
/*
@@ -234,7 +233,7 @@
ARGMOD(SymReg **r), int n, int emit)
{
ASSERT_ARGS(var_arg_ins)
- int op;
+ op_info_t *op;
Instruction *ins;
char fullname[64];
@@ -251,12 +250,12 @@
r[0]->pmc_type = enum_class_FixedIntegerArray;
op_fullname(fullname, name, r, 1, 0);
- op = interp->op_lib->op_code(interp, fullname, 1);
+ op = parrot_hash_get(interp, interp->op_hash, fullname);
- PARROT_ASSERT(op >= 0);
+ PARROT_ASSERT(op && STREQ(op->full_name, fullname));
ins = _mk_instruction(name, "", n, r, dirs);
- ins->opnum = op;
+ ins->op = op;
ins->opsize = n + 1;
if (emit)
@@ -309,33 +308,40 @@
return var_arg_ins(interp, unit, name, r, n, emit);
else {
Instruction *ins;
- int i, op, len;
+ int i, len;
int dirs = 0;
- op_info_t *op_info;
+ op_info_t *op;
char fullname[64] = "", format[128] = "";
op_fullname(fullname, name, r, n, keyvec);
- op = interp->op_lib->op_code(interp, fullname, 1);
+ op = parrot_hash_get(interp, interp->op_hash, fullname);
+ if (op && !STREQ(op->full_name, fullname))
+ op = NULL;
/* maybe we have a fullname */
- if (op < 0)
- op = interp->op_lib->op_code(interp, name, 1);
+ if (!op) {
+ op = parrot_hash_get(interp, interp->op_hash, name);
+ if (op && !STREQ(op->full_name, name))
+ op = NULL;
+ }
/* still wrong, try reverse compare */
- if (op < 0) {
+ if (!op) {
const char * const n_name = try_rev_cmp(name, r);
if (n_name) {
name = n_name;
op_fullname(fullname, name, r, n, keyvec);
- op = interp->op_lib->op_code(interp, fullname, 1);
+ op = parrot_hash_get(interp, interp->op_hash, fullname);
+ if (op && !STREQ(op->full_name, fullname))
+ op = NULL;
}
}
/* still wrong, try to find an existing op */
- if (op < 0)
+ if (!op)
op = try_find_op(interp, unit, name, r, n, keyvec, emit);
- if (op < 0) {
+ if (!op) {
int ok = 0;
/* check mixed constants */
@@ -356,26 +362,25 @@
else
strcpy(fullname, name);
- if (op < 0)
+ if (!op)
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"The opcode '%s' (%s<%d>) was not found. "
"Check the type and number of the arguments",
fullname, name, n);
- op_info = &interp->op_info_table[op];
*format = '\0';
/* info->op_count is args + 1
* build instruction format
* set LV_in / out flags */
- if (n != op_info->op_count - 1)
+ if (n != op->op_count - 1)
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"arg count mismatch: op #%d '%s' needs %d given %d",
- op, fullname, op_info->op_count-1, n);
+ op, fullname, op->op_count-1, n);
/* XXX Speed up some by keep track of the end of format ourselves */
for (i = 0; i < n; i++) {
- switch (op_info->dirs[i]) {
+ switch (op->dirs[i]) {
case PARROT_ARGDIR_INOUT:
dirs |= 1 << (16 + i);
/* go on */
@@ -422,7 +427,7 @@
ins->keys |= keyvec;
/* fill in oplib's info */
- ins->opnum = op;
+ ins->op = op;
ins->opsize = n + 1;
/* mark end as absolute branch */
@@ -443,8 +448,8 @@
/* set up branch flags
* mark registers that are labels */
- for (i = 0; i < op_info->op_count - 1; i++) {
- if (op_info->labels[i])
+ for (i = 0; i < op->op_count - 1; i++) {
+ if (op->labels[i])
ins->type |= ITBRANCH | (1 << i);
else {
if (r[i]->type == VTADDRESS)
@@ -453,7 +458,7 @@
}
}
- if (op_info->jump) {
+ if (op->jump) {
ins->type |= ITBRANCH;
/* TODO use opnum constants */
if (STREQ(name, "branch")
@@ -965,8 +970,8 @@
/*
-=item C<int try_find_op(PARROT_INTERP, IMC_Unit *unit, const char *name, SymReg
-**r, int n, int keyvec, int emit)>
+=item C<op_info_t * try_find_op(PARROT_INTERP, IMC_Unit *unit, const char *name,
+SymReg **r, int n, int keyvec, int emit)>
Try to find valid op doing the same operation e.g.
@@ -981,7 +986,7 @@
*/
PARROT_WARN_UNUSED_RESULT
-int
+op_info_t *
try_find_op(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(const char *name),
ARGMOD(SymReg **r), int n, int keyvec, int emit)
{
@@ -1017,11 +1022,15 @@
}
if (changed) {
+ op_info_t *op;
op_fullname(fullname, name, r, n, keyvec);
- return interp->op_lib->op_code(interp, fullname, 1);
+ op = parrot_hash_get(interp, interp->op_hash, fullname);
+ if (op && !STREQ(op->full_name, fullname))
+ op = NULL;
+ return op;
}
- return -1;
+ return NULL;
}
/*
Modified: branches/oplib_handling_cleanup/compilers/imcc/pbc.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/pbc.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/pbc.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -9,6 +9,7 @@
#include "parrot/pmc_freeze.h"
#include "pmc/pmc_sub.h"
#include "pmc/pmc_callcontext.h"
+#include "parrot/oplib/core_ops.h"
/* HEADERIZER HFILE: compilers/imcc/pbc.h */
@@ -642,6 +643,7 @@
ASSERT_ARGS(get_code_size)
Instruction *ins = unit->instructions;
size_t code_size;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
/* run through instructions:
* - sanity check
@@ -664,12 +666,12 @@
}
else if (ins->opname && *ins->opname) {
(*src_lines)++;
- if (ins->opnum < 0)
+ if (!ins->op)
IMCC_fatal(interp, 1, "get_code_size: "
"no opnum ins#%d %d\n",
ins->index, ins);
- if (ins->opnum == PARROT_OP_set_p_pc) {
+ if (ins->op == &core_ops->op_info_table[PARROT_OP_set_p_pc]) {
/* set_p_pc opcode */
IMCC_debug(interp, DEBUG_PBC_FIXUP, "PMC constant %s\n",
ins->symregs[1]->name);
@@ -702,11 +704,10 @@
static
opcode_t
-bytecode_map_op(PARROT_INTERP, opcode_t op) {
+bytecode_map_op(PARROT_INTERP, op_info_t *info) {
int i;
- op_info_t *info = &interp->op_info_table[op];
op_lib_t *lib = info->lib;
- op_func_t op_func = interp->op_func_table[op];
+ op_func_t op_func = OP_INFO_OPFUNC(info);
PackFile_ByteCode *bc = interp->code;
PackFile_ByteCode_OpMappingEntry *om;
@@ -857,6 +858,7 @@
ASSERT_ARGS(fixup_globals)
subs_t *s;
int jumppc = 0;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
for (s = IMCC_INFO(interp)->globals->cs->first; s; s = s->next) {
const SymHash * const hsh = &s->fixup;
@@ -912,7 +914,7 @@
SymReg * const nam = mk_const(interp, fixup->name,
fixup->type & VT_ENCODED ? 'U' : 'S');
- const int op = interp->op_lib->op_code(interp, "find_sub_not_null_p_sc", 1);
+ op_info_t *op = &core_ops->op_info_table[PARROT_OP_find_sub_not_null_p_sc];
PARROT_ASSERT(op);
interp->code->base.data[addr] = bytecode_map_op(interp, op);
@@ -2227,9 +2229,10 @@
ASSERT_ARGS(verify_signature)
PMC *changed_sig = NULL;
PMC * const sig_arr = interp->code->const_table->constants[pc[-1]].u.key;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
int needed = 0;
- int no_consts = (ins->opnum == PARROT_OP_get_results_pc
- || ins->opnum == PARROT_OP_get_params_pc);
+ int no_consts = (ins->op == &core_ops->op_info_table[PARROT_OP_get_results_pc]
+ || ins->op == &core_ops->op_info_table[PARROT_OP_get_params_pc]);
INTVAL i, n;
@@ -2305,7 +2308,8 @@
{
ASSERT_ARGS(e_pbc_emit)
int ok = 0;
- int op, i;
+ int i;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
/* first instruction, do initialisation ... */
if (ins == unit->instructions) {
@@ -2429,16 +2433,14 @@
IMCC_INFO(interp)->debug_seg->base.data[IMCC_INFO(interp)->ins_line++] =
(opcode_t)ins->line;
- op = (opcode_t)ins->opnum;
-
/* Get the info for that opcode */
- op_info = &interp->op_info_table[op];
+ op_info = ins->op;
IMCC_debug(interp, DEBUG_PBC, "%d %s", IMCC_INFO(interp)->npc,
op_info->full_name);
/* Start generating the bytecode */
- *(IMCC_INFO(interp)->pc)++ = bytecode_map_op(interp, op);
+ *(IMCC_INFO(interp)->pc)++ = bytecode_map_op(interp, op_info);
for (i = 0; i < op_info->op_count-1; i++) {
switch (op_info->types[i]) {
@@ -2490,10 +2492,10 @@
break;
}
}
- if (ins->opnum == PARROT_OP_set_args_pc
- || ins->opnum == PARROT_OP_get_results_pc
- || ins->opnum == PARROT_OP_get_params_pc
- || ins->opnum == PARROT_OP_set_returns_pc) {
+ if (ins->op == &core_ops->op_info_table[PARROT_OP_set_args_pc]
+ || ins->op == &core_ops->op_info_table[PARROT_OP_get_results_pc]
+ || ins->op == &core_ops->op_info_table[PARROT_OP_get_params_pc]
+ || ins->op == &core_ops->op_info_table[PARROT_OP_set_returns_pc]) {
/* TODO get rid of verify_signature - PIR call sigs are already
* fixed, but PASM still needs it */
Modified: branches/oplib_handling_cleanup/compilers/imcc/pcc.c
==============================================================================
--- branches/oplib_handling_cleanup/compilers/imcc/pcc.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/compilers/imcc/pcc.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -29,6 +29,7 @@
#include <string.h>
#include "imc.h"
#include "parser.h"
+#include "parrot/oplib/core_ops.h"
/* HEADERIZER HFILE: compilers/imcc/imc.h */
@@ -675,6 +676,7 @@
SymReg *regs[2];
Instruction *get_params, *tmp_ins, *unused_ins;
char *buf;
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
if (!(unit->instructions->type & ITLABEL))
return 0;
@@ -696,7 +698,7 @@
get_params = unit->instructions->next;
- if (get_params->opnum != PARROT_OP_get_params_pc)
+ if (get_params->op != &core_ops->op_info_table[PARROT_OP_get_params_pc])
return 0;
buf = (char *)malloc(strlen(this_sub->name) + 3);
Modified: branches/oplib_handling_cleanup/config/gen/config_h/config_h.in
==============================================================================
--- branches/oplib_handling_cleanup/config/gen/config_h/config_h.in Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/config/gen/config_h/config_h.in Fri Sep 10 18:01:50 2010 (r48910)
@@ -150,8 +150,11 @@
#define PARROT_ at jitcpu@ 1
/* Oplib and dynamic ops related. */
-#define PARROT_CORE_OPLIB_NAME "core_ops"
-#define PARROT_CORE_OPLIB_INIT Parrot_DynOp_core_ at MAJOR@_ at MINOR@_ at PATCH@
+#define PARROT_CORE_OPLIB_NAME "core_ops"
+#define PARROT_CORE_OPLIB_INIT Parrot_DynOp_core_ at MAJOR@_ at MINOR@_ at PATCH@
+
+#include "parrot/oplib/core_ops.h"
+#define PARROT_GET_CORE_OPLIB(i) PARROT_CORE_OPLIB_INIT(i, 1)
/* ICU. */
#define PARROT_HAS_ICU @has_icu@
Modified: branches/oplib_handling_cleanup/include/parrot/op.h
==============================================================================
--- branches/oplib_handling_cleanup/include/parrot/op.h Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/include/parrot/op.h Fri Sep 10 18:01:50 2010 (r48910)
@@ -78,6 +78,9 @@
struct op_lib_t *lib;
} op_info_t;
+#define OP_INFO_OPNUM(oi) ((oi) - (oi)->lib->op_info_table)
+#define OP_INFO_OPFUNC(oi) ((oi)->lib->op_func_table[OP_INFO_OPNUM(oi)])
+
#define OPCODE_IS(interp, seg, opnum, global_opnum) \
((seg)->op_func_table[(opnum)] == (interp)->op_func_table[(global_opnum)])
Modified: branches/oplib_handling_cleanup/include/parrot/oplib.h
==============================================================================
--- branches/oplib_handling_cleanup/include/parrot/oplib.h Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/include/parrot/oplib.h Fri Sep 10 18:01:50 2010 (r48910)
@@ -32,7 +32,7 @@
size_t op_count;
op_info_t * op_info_table;
op_func_t * op_func_table;
- int (*op_code)(PARROT_INTERP, const char * name, int full);
+ int (*_op_code)(PARROT_INTERP, const char * name, int full);
} op_lib_t;
typedef enum {
Modified: branches/oplib_handling_cleanup/src/embed.c
==============================================================================
--- branches/oplib_handling_cleanup/src/embed.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/src/embed.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -25,6 +25,7 @@
#include "pmc/pmc_sub.h"
#include "pmc/pmc_callcontext.h"
#include "parrot/runcore_api.h"
+#include "parrot/oplib/core_ops.h"
#include "../compilers/imcc/imc.h"
@@ -1077,6 +1078,7 @@
Parrot_run_native(PARROT_INTERP, native_func_t func)
{
ASSERT_ARGS(Parrot_run_native)
+ op_lib_t *core_ops = PARROT_GET_CORE_OPLIB(interp);
PackFile * const pf = PackFile_new(interp, 0);
static opcode_t program_code[2] = {
0, /* enternative */
@@ -1084,8 +1086,8 @@
};
static op_func_t op_func_table[2];
- op_func_table[0] = interp->op_func_table[ interp->op_lib->op_code(interp, "enternative", 0) ];
- op_func_table[1] = interp->op_func_table[ interp->op_lib->op_code(interp, "end", 0) ];
+ op_func_table[0] = core_ops->op_func_table[PARROT_OP_enternative];
+ op_func_table[1] = core_ops->op_func_table[PARROT_OP_end];
pf->cur_cs = (PackFile_ByteCode *)
Modified: branches/oplib_handling_cleanup/src/pmc/oplib.pmc
==============================================================================
--- branches/oplib_handling_cleanup/src/pmc/oplib.pmc Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/src/pmc/oplib.pmc Fri Sep 10 18:01:50 2010 (r48910)
@@ -64,9 +64,9 @@
INTVAL num;
GET_ATTR_oplib(INTERP, SELF, oplib);
- num = oplib->op_code(INTERP, cstr, 1);
+ num = oplib->_op_code(INTERP, cstr, 1);
if (num == -1)
- num = oplib->op_code(INTERP, cstr, 0);
+ num = oplib->_op_code(INTERP, cstr, 0);
Parrot_str_free_cstring(cstr);
return num;
Modified: branches/oplib_handling_cleanup/src/runcore/main.c
==============================================================================
--- branches/oplib_handling_cleanup/src/runcore/main.c Fri Sep 10 15:28:24 2010 (r48909)
+++ branches/oplib_handling_cleanup/src/runcore/main.c Fri Sep 10 18:01:50 2010 (r48910)
@@ -272,15 +272,6 @@
mem_gc_free(interp, interp->all_op_libs);
interp->all_op_libs = NULL;
-
- /* dynop libs */
- if (interp->n_libs <= 0)
- return;
-
- mem_gc_free(interp, interp->op_info_table);
- mem_gc_free(interp, interp->op_func_table);
- interp->op_info_table = NULL;
- interp->op_func_table = NULL;
}
@@ -345,6 +336,9 @@
return;
}
+ parrot_hash_oplib(interp, lib);
+ return;
+
n_old = interp->op_count;
n_new = lib->op_count;
n_tot = n_old + n_new;
@@ -414,21 +408,6 @@
}
-
-
-/*
-
-=item C<static void dynop_register_switch(PARROT_INTERP, size_t n_old, size_t
-n_new)>
-
-Used only at the end of dynop_register. Sums the old and new op_counts
-storing the result into the operations count field of the interpreter
-object.
-
-=cut
-
-*/
-
static void
dynop_register_switch(PARROT_INTERP, size_t n_old, size_t n_new)
{
More information about the parrot-commits
mailing list