[svn:parrot] r48518 - in branches/unshared_buffers: . compilers/imcc examples/languages/squaak examples/languages/squaak/doc include/parrot runtime/parrot/library runtime/parrot/library/HTTP src src/call src/gc src/interp src/ops src/pmc src/runcore src/string t/codingstd t/compilers/pge/p5regex t/dynoplibs t/native_pbc t/op t/perl t/src tools/dev
darbelo at svn.parrot.org
darbelo at svn.parrot.org
Mon Aug 16 00:44:32 UTC 2010
Author: darbelo
Date: Mon Aug 16 00:44:30 2010
New Revision: 48518
URL: https://trac.parrot.org/parrot/changeset/48518
Log:
Sync with trunk.
Modified:
branches/unshared_buffers/ (props changed)
branches/unshared_buffers/CREDITS
branches/unshared_buffers/DEPRECATED.pod
branches/unshared_buffers/compilers/imcc/imcparser.c
branches/unshared_buffers/compilers/imcc/imcparser.h
branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_1.pod
branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_2.pod
branches/unshared_buffers/examples/languages/squaak/setup.pir
branches/unshared_buffers/include/parrot/namespace.h
branches/unshared_buffers/include/parrot/pmc_freeze.h
branches/unshared_buffers/include/parrot/pobj.h
branches/unshared_buffers/include/parrot/runcore_trace.h (props changed)
branches/unshared_buffers/runtime/parrot/library/HTTP/Message.pir
branches/unshared_buffers/runtime/parrot/library/distutils.pir
branches/unshared_buffers/src/call/args.c
branches/unshared_buffers/src/gc/alloc_resources.c
branches/unshared_buffers/src/gc/gc_ms.c
branches/unshared_buffers/src/gc/gc_private.h
branches/unshared_buffers/src/gc/mark_sweep.c
branches/unshared_buffers/src/hll.c
branches/unshared_buffers/src/interp/inter_create.c (props changed)
branches/unshared_buffers/src/namespace.c
branches/unshared_buffers/src/ops/core.ops
branches/unshared_buffers/src/packfile.c
branches/unshared_buffers/src/packout.c
branches/unshared_buffers/src/pmc/bigint.pmc
branches/unshared_buffers/src/pmc/bignum.pmc
branches/unshared_buffers/src/pmc/callcontext.pmc
branches/unshared_buffers/src/pmc/capture.pmc
branches/unshared_buffers/src/pmc/class.pmc
branches/unshared_buffers/src/pmc/complex.pmc
branches/unshared_buffers/src/pmc/coroutine.pmc
branches/unshared_buffers/src/pmc/eval.pmc
branches/unshared_buffers/src/pmc/fixedintegerarray.pmc
branches/unshared_buffers/src/pmc/fixedpmcarray.pmc
branches/unshared_buffers/src/pmc/fixedstringarray.pmc
branches/unshared_buffers/src/pmc/hash.pmc
branches/unshared_buffers/src/pmc/imageio.pmc
branches/unshared_buffers/src/pmc/imageiosize.pmc
branches/unshared_buffers/src/pmc/integer.pmc
branches/unshared_buffers/src/pmc/null.pmc
branches/unshared_buffers/src/pmc/orderedhash.pmc
branches/unshared_buffers/src/pmc/packfile.pmc
branches/unshared_buffers/src/pmc/packfiledirectory.pmc
branches/unshared_buffers/src/pmc/resizablepmcarray.pmc
branches/unshared_buffers/src/pmc/sub.pmc
branches/unshared_buffers/src/pmc/threadinterpreter.pmc
branches/unshared_buffers/src/pmc_freeze.c
branches/unshared_buffers/src/runcore/cores.c (props changed)
branches/unshared_buffers/src/runcore/trace.c (props changed)
branches/unshared_buffers/src/string/api.c
branches/unshared_buffers/t/codingstd/pmc_docs.t
branches/unshared_buffers/t/compilers/pge/p5regex/p5rx.t
branches/unshared_buffers/t/dynoplibs/deprecated.t
branches/unshared_buffers/t/native_pbc/annotations.pbc
branches/unshared_buffers/t/native_pbc/integer.pbc
branches/unshared_buffers/t/native_pbc/integer_1.pbc
branches/unshared_buffers/t/native_pbc/number.pbc
branches/unshared_buffers/t/native_pbc/number_1.pbc
branches/unshared_buffers/t/native_pbc/string.pbc
branches/unshared_buffers/t/native_pbc/string_1.pbc
branches/unshared_buffers/t/op/calling.t
branches/unshared_buffers/t/op/cmp-nonbranch.t
branches/unshared_buffers/t/op/string.t
branches/unshared_buffers/t/perl/Parrot_Test.t
branches/unshared_buffers/t/src/embed.t (props changed)
branches/unshared_buffers/tools/dev/mk_gitignore.pl (props changed)
Modified: branches/unshared_buffers/CREDITS
==============================================================================
--- branches/unshared_buffers/CREDITS Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/CREDITS Mon Aug 16 00:44:30 2010 (r48518)
@@ -248,7 +248,7 @@
A: christoph_googleacct at mksig.org
A: christop... at mksig.org
A: Christoph Otto
-D: Pipp
+D: Pipp, Lorito taskmaster
E: christoph at mksig.org
N: chromatic
@@ -816,7 +816,9 @@
N: Paul C. Anagnostopoulos
U: Paul_the_Greek
-D: Memory management
+A: Paul C. Anagnostopoulos
+E: paul at windfall.com
+D: Improving memory management documentation
N: Paul Cochrane
U: paultcochrane
Modified: branches/unshared_buffers/DEPRECATED.pod
==============================================================================
--- branches/unshared_buffers/DEPRECATED.pod Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/DEPRECATED.pod Mon Aug 16 00:44:30 2010 (r48518)
@@ -249,6 +249,10 @@
L<https://trac.parrot.org/parrot/ticket/1655>
+=item errorson, errorsoff operations [eligible in 2.10]
+
+The C<.PARROT_ERRORS_GLOBAL_FLAG> flag will be eliminated. It is not used by Parrot.
+
=back
=head1 Bytecode
@@ -344,12 +348,6 @@
L<https://trac.parrot.org/parrot/ticket/443>
-=item C<Parrot_find_global_s> and C<Parrot_store_global_s>
-
-This function is not used or tested anywhere.
-
-http://trac.parrot.org/parrot/ticket/1660
-
=item PMC Attributes Allocation Functions [experimental]
Parrot_gc_allocate_pmc_attributes
Modified: branches/unshared_buffers/compilers/imcc/imcparser.c
==============================================================================
--- branches/unshared_buffers/compilers/imcc/imcparser.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/compilers/imcc/imcparser.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -9,12 +9,13 @@
*/
/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */
-/* A Bison parser, made by GNU Bison 2.4.2. */
+
+/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ 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
@@ -56,7 +57,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.2"
+#define YYBISON_VERSION "2.4.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -1150,7 +1151,7 @@
/* Line 189 of yacc.c */
-#line 1143 "compilers/imcc/imcparser.c"
+#line 1144 "compilers/imcc/imcparser.c"
/* Enabling traces. */
#ifndef YYDEBUG
@@ -1434,7 +1435,7 @@
/* Line 214 of yacc.c */
-#line 1427 "compilers/imcc/imcparser.c"
+#line 1428 "compilers/imcc/imcparser.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -1446,7 +1447,7 @@
/* Line 264 of yacc.c */
-#line 1439 "compilers/imcc/imcparser.c"
+#line 1440 "compilers/imcc/imcparser.c"
#ifdef short
# undef short
@@ -1496,7 +1497,7 @@
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
+# if YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -2443,18 +2444,9 @@
/* 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. 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. */
+ Once GCC version 2 has supplanted version 1, this can go. */
#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)
@@ -2511,7 +2503,7 @@
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+# if YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -3262,28 +3254,28 @@
{
case 2:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1166 "compilers/imcc/imcc.y"
{ if (yynerrs) YYABORT; (yyval.i) = 0; }
break;
case 5:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1175 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 6:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1176 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 7:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1178 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
@@ -3294,7 +3286,7 @@
case 8:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1184 "compilers/imcc/imcc.y"
{
(yyval.i) = (yyvsp[(1) - (1)].i);
@@ -3305,42 +3297,42 @@
case 9:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1189 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 10:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1190 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 11:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1191 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 12:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1192 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 13:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1196 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 14:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1198 "compilers/imcc/imcc.y"
{
(yyval.i) = 0;
@@ -3351,7 +3343,7 @@
case 15:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1207 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->line = atoi((yyvsp[(2) - (5)].s));
@@ -3362,7 +3354,7 @@
case 16:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1213 "compilers/imcc/imcc.y"
{
/* set_filename() frees the STRINGC */
@@ -3372,7 +3364,7 @@
case 17:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1221 "compilers/imcc/imcc.y"
{
/* We'll want to store an entry while emitting instructions, so just
@@ -3385,7 +3377,7 @@
case 18:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1233 "compilers/imcc/imcc.y"
{
STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
@@ -3400,14 +3392,14 @@
case 19:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1245 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 20:
-/* Line 1464 of yacc.c */
+/* Line 1455 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);
@@ -3418,14 +3410,14 @@
case 21:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1254 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 22:
-/* Line 1464 of yacc.c */
+/* Line 1455 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));
@@ -3436,14 +3428,14 @@
case 23:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1261 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 24:
-/* Line 1464 of yacc.c */
+/* Line 1455 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));
@@ -3455,49 +3447,49 @@
case 29:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1280 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 30:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1281 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 31:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1282 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 32:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1283 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 33:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1284 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 36:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1289 "compilers/imcc/imcc.y"
{ clear_state(interp); }
break;
case 37:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1291 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp, IMCC_INFO(interp)->cur_unit,
@@ -3509,7 +3501,7 @@
case 38:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1298 "compilers/imcc/imcc.y"
{
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
@@ -3519,7 +3511,7 @@
case 39:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1303 "compilers/imcc/imcc.y"
{
(yyval.i) = iSUBROUTINE(interp,
@@ -3532,7 +3524,7 @@
case 40:
-/* Line 1464 of yacc.c */
+/* Line 1455 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));
@@ -3541,7 +3533,7 @@
case 41:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1315 "compilers/imcc/imcc.y"
{
char *name = mem_sys_strdup((yyvsp[(2) - (4)].s) + 1);
@@ -3559,21 +3551,21 @@
case 42:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1327 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;}
break;
case 44:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1335 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); }
break;
case 45:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1338 "compilers/imcc/imcc.y"
{
/* if (optimizer_level & OPT_PASM)
@@ -3586,7 +3578,7 @@
case 48:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1354 "compilers/imcc/imcc.y"
{
int re_open = 0;
@@ -3603,21 +3595,21 @@
case 49:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1368 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); }
break;
case 50:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1369 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; }
break;
case 51:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1373 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
@@ -3626,7 +3618,7 @@
case 52:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1377 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
@@ -3637,14 +3629,14 @@
case 53:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1387 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
@@ -3654,7 +3646,7 @@
case 55:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1395 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB);
@@ -3663,7 +3655,7 @@
case 56:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1399 "compilers/imcc/imcc.y"
{
iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr));
@@ -3672,7 +3664,7 @@
case 57:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1403 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(5) - (6)].t);
@@ -3685,28 +3677,28 @@
case 58:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1411 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 59:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1415 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 60:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1416 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 61:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1418 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -3721,21 +3713,21 @@
case 62:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1430 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 63:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1435 "compilers/imcc/imcc.y"
{
if ((yyvsp[(3) - (3)].t) & VT_OPT_FLAG && (yyvsp[(1) - (3)].t) != 'I') {
@@ -3760,14 +3752,14 @@
case 65:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1459 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 66:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1464 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3778,7 +3770,7 @@
case 67:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1470 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3789,7 +3781,7 @@
case 68:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1479 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
@@ -3800,7 +3792,7 @@
case 69:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1485 "compilers/imcc/imcc.y"
{
(yyval.t) = P_VTABLE;
@@ -3811,7 +3803,7 @@
case 70:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1494 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
@@ -3822,7 +3814,7 @@
case 71:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1500 "compilers/imcc/imcc.y"
{
(yyval.t) = P_METHOD;
@@ -3833,7 +3825,7 @@
case 72:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1509 "compilers/imcc/imcc.y"
{
(yyval.t) = P_NSENTRY;
@@ -3844,7 +3836,7 @@
case 73:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1515 "compilers/imcc/imcc.y"
{
(yyval.t) = P_NSENTRY;
@@ -3855,7 +3847,7 @@
case 74:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1524 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3865,7 +3857,7 @@
case 75:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1532 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3875,7 +3867,7 @@
case 76:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1537 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3887,7 +3879,7 @@
case 77:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1547 "compilers/imcc/imcc.y"
{
add_pcc_multi(interp, IMCC_INFO(interp)->cur_call, NULL);
@@ -3896,7 +3888,7 @@
case 78:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1551 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3906,7 +3898,7 @@
case 79:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1556 "compilers/imcc/imcc.y"
{
(yyval.t) = 0;
@@ -3916,35 +3908,35 @@
case 80:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1563 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "INTVAL", 'S'); }
break;
case 81:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1564 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); }
break;
case 82:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1565 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "PMC", 'S'); }
break;
case 83:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1566 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_const(interp, "STRING", 'S'); }
break;
case 84:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1568 "compilers/imcc/imcc.y"
{
SymReg *r;
@@ -3960,7 +3952,7 @@
case 85:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1579 "compilers/imcc/imcc.y"
{
SymReg *r;
@@ -3976,14 +3968,14 @@
case 86:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1589 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (3)].sr); }
break;
case 89:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1599 "compilers/imcc/imcc.y"
{
char name[128];
@@ -4010,112 +4002,112 @@
case 90:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1625 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 91:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1634 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; }
break;
case 94:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1639 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 97:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1644 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (1)].t); }
break;
case 98:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1645 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 99:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1649 "compilers/imcc/imcc.y"
{ (yyval.t) = P_LOAD; }
break;
case 100:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1650 "compilers/imcc/imcc.y"
{ (yyval.t) = P_INIT; }
break;
case 101:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1651 "compilers/imcc/imcc.y"
{ (yyval.t) = P_MAIN; }
break;
case 102:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1652 "compilers/imcc/imcc.y"
{ (yyval.t) = P_IMMEDIATE; }
break;
case 103:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1653 "compilers/imcc/imcc.y"
{ (yyval.t) = P_POSTCOMP; }
break;
case 104:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1654 "compilers/imcc/imcc.y"
{ (yyval.t) = P_ANON; }
break;
case 105:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1655 "compilers/imcc/imcc.y"
{ (yyval.t) = P_NEED_LEX; }
break;
case 113:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1667 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
@@ -4125,7 +4117,7 @@
case 114:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1672 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -4134,7 +4126,7 @@
case 115:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1676 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -4143,7 +4135,7 @@
case 116:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1680 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
@@ -4152,7 +4144,7 @@
case 117:
-/* Line 1464 of yacc.c */
+/* Line 1455 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'));
@@ -4161,7 +4153,7 @@
case 118:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1688 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
@@ -4171,7 +4163,7 @@
case 119:
-/* Line 1464 of yacc.c */
+/* Line 1455 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'));
@@ -4181,14 +4173,14 @@
case 120:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1701 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 121:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1702 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4203,21 +4195,21 @@
case 122:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1714 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(2) - (2)].sr); }
break;
case 123:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1719 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 124:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1721 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
@@ -4227,21 +4219,21 @@
case 125:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1729 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 127:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1730 "compilers/imcc/imcc.y"
{
IdList * const l = (yyvsp[(4) - (4)].idlist);
@@ -4255,91 +4247,91 @@
case 128:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1741 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 129:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1742 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 130:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1746 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; }
break;
case 131:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1747 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPTIONAL; }
break;
case 132:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1748 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_OPT_FLAG; }
break;
case 133:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1749 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; }
break;
case 134:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1752 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 137:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1753 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_CALL_SIG; }
break;
case 138:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1758 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 0); }
break;
case 139:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1760 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 140:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1762 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
@@ -4349,28 +4341,28 @@
case 141:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1769 "compilers/imcc/imcc.y"
{ begin_return_or_yield(interp, 1); }
break;
case 142:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1771 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 143:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1775 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 144:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1777 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
@@ -4380,7 +4372,7 @@
case 145:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1782 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
@@ -4390,14 +4382,14 @@
case 146:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1789 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 147:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1791 "compilers/imcc/imcc.y"
{
if ((yyvsp[(1) - (2)].sr))
@@ -4407,7 +4399,7 @@
case 148:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1796 "compilers/imcc/imcc.y"
{
if ((yyvsp[(2) - (3)].sr))
@@ -4417,21 +4409,21 @@
case 149:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1812 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->asm_state == AsmDefault)
@@ -4441,7 +4433,7 @@
case 152:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1817 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->asm_state = AsmDefault;
@@ -4451,28 +4443,28 @@
case 153:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1824 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 154:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1825 "compilers/imcc/imcc.y"
{ (yyval.t) = 1; }
break;
case 155:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1829 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 156:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1831 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4487,7 +4479,7 @@
case 157:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1841 "compilers/imcc/imcc.y"
{
SymReg * const name = mk_const(interp, (yyvsp[(1) - (3)].s), 'S');
@@ -4497,7 +4489,7 @@
case 158:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1846 "compilers/imcc/imcc.y"
{
if (IMCC_INFO(interp)->adv_named_id) {
@@ -4512,7 +4504,7 @@
case 159:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1856 "compilers/imcc/imcc.y"
{
SymReg * const name = mk_const(interp, (yyvsp[(3) - (5)].s), 'S');
@@ -4522,63 +4514,63 @@
case 162:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1877 "compilers/imcc/imcc.y"
{ clear_state(interp); }
break;
case 163:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1882 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (2)].i); }
break;
case 164:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1883 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 165:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1884 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 166:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1885 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 167:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1886 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 168:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1887 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 169:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1891 "compilers/imcc/imcc.y"
{ (yyval.i) = NULL; }
break;
case 173:
-/* Line 1464 of yacc.c */
+/* Line 1455 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)));
@@ -4589,14 +4581,14 @@
case 174:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1912 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (3)].i); }
break;
case 175:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1914 "compilers/imcc/imcc.y"
{
if (yynerrs >= PARROT_MAX_RECOVER_ERRORS) {
@@ -4609,7 +4601,7 @@
case 176:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1925 "compilers/imcc/imcc.y"
{
IdList* const l = (yyvsp[(1) - (1)].idlist);
@@ -4620,7 +4612,7 @@
case 177:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1932 "compilers/imcc/imcc.y"
{
IdList* const l = (yyvsp[(3) - (3)].idlist);
@@ -4631,7 +4623,7 @@
case 178:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1941 "compilers/imcc/imcc.y"
{
IdList* const l = mem_gc_allocate_n_zeroed_typed(interp, 1, IdList);
@@ -4642,14 +4634,14 @@
case 183:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1957 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 184:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1958 "compilers/imcc/imcc.y"
{
IdList *l = (yyvsp[(4) - (4)].idlist);
@@ -4667,7 +4659,7 @@
case 185:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1971 "compilers/imcc/imcc.y"
{
if ((yyvsp[(4) - (4)].sr)->set != 'P') {
@@ -4689,7 +4681,7 @@
case 186:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 1988 "compilers/imcc/imcc.y"
{
if ((yyvsp[(4) - (4)].sr)->set != 'P') {
@@ -4707,14 +4699,14 @@
case 187:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2000 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 188:
-/* Line 1464 of yacc.c */
+/* Line 1455 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);
@@ -4725,14 +4717,14 @@
case 190:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2008 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->is_def = 1; }
break;
case 191:
-/* Line 1464 of yacc.c */
+/* Line 1455 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);
@@ -4743,7 +4735,7 @@
case 192:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2015 "compilers/imcc/imcc.y"
{
(yyval.i) = NULL;
@@ -4754,7 +4746,7 @@
case 193:
-/* Line 1464 of yacc.c */
+/* Line 1455 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));
@@ -4763,7 +4755,7 @@
case 194:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2025 "compilers/imcc/imcc.y"
{
(yyval.i) = INS(interp,
@@ -4780,98 +4772,98 @@
case 195:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2037 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 197:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2038 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 200:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2041 "compilers/imcc/imcc.y"
{ (yyval.i) = 0;}
break;
case 201:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2045 "compilers/imcc/imcc.y"
{ (yyval.t) = 'I'; }
break;
case 202:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2046 "compilers/imcc/imcc.y"
{ (yyval.t) = 'N'; }
break;
case 203:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2047 "compilers/imcc/imcc.y"
{ (yyval.t) = 'S'; }
break;
case 204:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2048 "compilers/imcc/imcc.y"
{ (yyval.t) = 'P'; }
break;
case 205:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2064 "compilers/imcc/imcc.y"
{
add_pcc_result(interp, (yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr));
@@ -4882,7 +4874,7 @@
case 211:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2070 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
@@ -4891,7 +4883,7 @@
case 212:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2074 "compilers/imcc/imcc.y"
{
IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr));
@@ -4901,7 +4893,7 @@
case 216:
-/* Line 1464 of yacc.c */
+/* Line 1455 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));
@@ -4910,189 +4902,189 @@
case 217:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2089 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"not"; }
break;
case 218:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2090 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bnot"; }
break;
case 219:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2091 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"neg"; }
break;
case 220:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2095 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; }
break;
case 221:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2096 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; }
break;
case 222:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2097 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; }
break;
case 223:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2098 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; }
break;
case 224:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2099 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; }
break;
case 225:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2100 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; }
break;
case 226:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2101 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"pow"; }
break;
case 227:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2102 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; }
break;
case 228:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2103 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"iseq"; }
break;
case 229:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2104 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isne"; }
break;
case 230:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2105 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isgt"; }
break;
case 231:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2106 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isge"; }
break;
case 232:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2107 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"islt"; }
break;
case 233:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2108 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"isle"; }
break;
case 234:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2109 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; }
break;
case 235:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2110 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; }
break;
case 236:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2111 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; }
break;
case 237:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2112 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"and"; }
break;
case 238:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2113 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"or"; }
break;
case 239:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2114 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"xor"; }
break;
case 240:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2115 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; }
break;
case 241:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2116 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; }
break;
case 242:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2117 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; }
break;
case 243:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2123 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
@@ -5103,112 +5095,112 @@
case 244:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2128 "compilers/imcc/imcc.y"
{ (yyval.i) = 0; }
break;
case 245:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2139 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"add"; }
break;
case 247:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2140 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"sub"; }
break;
case 248:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2141 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mul"; }
break;
case 249:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2142 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"div"; }
break;
case 250:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2143 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"mod"; }
break;
case 251:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2144 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"fdiv"; }
break;
case 252:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2145 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"concat"; }
break;
case 253:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2146 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"band"; }
break;
case 254:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2147 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bor"; }
break;
case 255:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2148 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"bxor"; }
break;
case 256:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2149 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shr"; }
break;
case 257:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2150 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"shl"; }
break;
case 258:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2151 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lsr"; }
break;
case 259:
-/* Line 1464 of yacc.c */
+/* Line 1455 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),
@@ -5221,28 +5213,28 @@
case 260:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2171 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(1) - (1)].sr);
@@ -5253,7 +5245,7 @@
case 264:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2177 "compilers/imcc/imcc.y"
{
/* disallow bareword method names; SREG name constants are fine */
@@ -5272,7 +5264,7 @@
case 265:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2191 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
@@ -5283,7 +5275,7 @@
case 266:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2197 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
@@ -5294,14 +5286,14 @@
case 267:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2208 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
@@ -5311,21 +5303,21 @@
case 269:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2212 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(2) - (5)].i); }
break;
case 270:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2216 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 271:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2218 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5340,7 +5332,7 @@
case 272:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2228 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5355,7 +5347,7 @@
case 273:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2238 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5367,7 +5359,7 @@
case 274:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2245 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5377,7 +5369,7 @@
case 275:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2250 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5389,70 +5381,70 @@
case 276:
-/* Line 1464 of yacc.c */
+/* Line 1455 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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2263 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 278:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2264 "compilers/imcc/imcc.y"
{ (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 279:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2268 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_FLAT; }
break;
case 280:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2269 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_NAMED; }
break;
case 281:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2270 "compilers/imcc/imcc.y"
{ (yyval.t) = VT_CALL_SIG; }
break;
case 282:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2273 "compilers/imcc/imcc.y"
{ adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
case 283:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2274 "compilers/imcc/imcc.y"
{ adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
case 284:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2278 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
break;
case 285:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2283 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5467,7 +5459,7 @@
case 286:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2293 "compilers/imcc/imcc.y"
{
add_pcc_named_result(interp, IMCC_INFO(interp)->cur_call,
@@ -5478,7 +5470,7 @@
case 287:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2299 "compilers/imcc/imcc.y"
{
(yyval.sr) = 0;
@@ -5493,7 +5485,7 @@
case 288:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2309 "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));
@@ -5503,28 +5495,28 @@
case 289:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2313 "compilers/imcc/imcc.y"
{ (yyval.sr) = 0; }
break;
case 290:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2317 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 291:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2318 "compilers/imcc/imcc.y"
{ (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 292:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2323 "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));
@@ -5533,7 +5525,7 @@
case 293:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2327 "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));
@@ -5542,7 +5534,7 @@
case 294:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2331 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
@@ -5551,7 +5543,7 @@
case 295:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2338 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
@@ -5560,7 +5552,7 @@
case 296:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2342 "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));
@@ -5569,7 +5561,7 @@
case 297:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2346 "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));
@@ -5578,91 +5570,91 @@
case 298:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2352 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 299:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2353 "compilers/imcc/imcc.y"
{ (yyval.t) = 0; }
break;
case 300:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2357 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"eq"; }
break;
case 301:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2358 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ne"; }
break;
case 302:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2359 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"gt"; }
break;
case 303:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2360 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"ge"; }
break;
case 304:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2361 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"lt"; }
break;
case 305:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2362 "compilers/imcc/imcc.y"
{ (yyval.s) = (char *)"le"; }
break;
case 308:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2371 "compilers/imcc/imcc.y"
{ (yyval.sr) = NULL; }
break;
case 309:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2372 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (1)].sr); }
break;
case 310:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2376 "compilers/imcc/imcc.y"
{ (yyval.sr) = IMCC_INFO(interp)->regs[0]; }
break;
case 312:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2381 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); }
break;
case 313:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2383 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (4)].sr);
@@ -5674,7 +5666,7 @@
case 314:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2390 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr);
@@ -5684,49 +5676,49 @@
case 316:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2397 "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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2398 "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 1464 of yacc.c */
+/* Line 1455 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 319:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2403 "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 1464 of yacc.c */
+/* Line 1455 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 321:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2408 "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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2422 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
@@ -5735,7 +5727,7 @@
case 327:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2426 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
@@ -5746,7 +5738,7 @@
case 328:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2434 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
@@ -5755,7 +5747,7 @@
case 329:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2438 "compilers/imcc/imcc.y"
{
(yyval.sr) = link_keys(interp,
@@ -5766,14 +5758,14 @@
case 330:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2446 "compilers/imcc/imcc.y"
{ IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); }
break;
case 331:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2448 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
@@ -5783,7 +5775,7 @@
case 332:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2456 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(1) - (1)].sr);
@@ -5792,78 +5784,78 @@
case 333:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2462 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); }
break;
case 334:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2463 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); }
break;
case 335:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2464 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); }
break;
case 336:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2465 "compilers/imcc/imcc.y"
{ (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); }
break;
case 337:
-/* Line 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2466 "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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2470 "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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2471 "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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2475 "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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2476 "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 1464 of yacc.c */
+/* Line 1455 of yacc.c */
#line 2477 "compilers/imcc/imcc.y"
{ (yyval.sr) = (yyvsp[(1) - (1)].sr); }
break;
-/* Line 1464 of yacc.c */
-#line 5856 "compilers/imcc/imcparser.c"
+/* Line 1455 of yacc.c */
+#line 5848 "compilers/imcc/imcparser.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -6074,7 +6066,7 @@
-/* Line 1684 of yacc.c */
+/* Line 1675 of yacc.c */
#line 2483 "compilers/imcc/imcc.y"
Modified: branches/unshared_buffers/compilers/imcc/imcparser.h
==============================================================================
--- branches/unshared_buffers/compilers/imcc/imcparser.h Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/compilers/imcc/imcparser.h Mon Aug 16 00:44:30 2010 (r48518)
@@ -9,12 +9,13 @@
*/
/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */
-/* A Bison parser, made by GNU Bison 2.4.2. */
+
+/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
- Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ 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
@@ -294,7 +295,7 @@
typedef union YYSTYPE
{
-/* Line 1685 of yacc.c */
+/* Line 1676 of yacc.c */
#line 1071 "compilers/imcc/imcc.y"
IdList * idlist;
@@ -305,8 +306,8 @@
-/* Line 1685 of yacc.c */
-#line 299 "compilers/imcc/imcparser.h"
+/* Line 1676 of yacc.c */
+#line 300 "compilers/imcc/imcparser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
Modified: branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_1.pod
==============================================================================
--- branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_1.pod Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_1.pod Mon Aug 16 00:44:30 2010 (r48518)
@@ -30,7 +30,7 @@
The Facts: 1) Parrot is suitable for running virtually any dynamic language
known, but before doing so, compilers must be written, and 2) writing compilers
-is rather difficult.
+from scratch is rather difficult.
=head2 The Parrot Compiler Toolkit
@@ -42,24 +42,28 @@
designed to do just that: provide powerful tools to make writing a compiler for
Parrot childishly easy.
-This tutorial will introduce the PCT by demonstrating the ease with which a
-(simple) language can be implemented for Parrot. The case study language is not
-as complex as a real-world language, but this tutorial is written to whet your
-appetite and show the power of the PCT. This tutorial will also present some
+This tutorial introduces the PCT by showing how a simple case study language is
+implemented for Parrot. The sample language is not
+as complex as a real-world language, but is interesting enough to whet your
+appetite and show the power of the PCT.
+
+This tutorial also presents some
exercises which you can explore in order to learn more details of the PCT not
covered in this tutorial.
=head2 Squaak: A Simple Language
-The case study language, named Squaak, that we will be implementing on Parrot
-will be a full-fledged compiler that can compile a program from source into
-Parrot Intermediate Representation (PIR) (or run the PIR immediately). It can
-also be used as a command-line interpreter. Squaak demonstrates some common
-language constructs, but at the same time is lacking some other, seemingly
-simple features. For instance, our language will not have return, break or
+The case study language is named Squaak. We will be implementing on Parrot
+a full-fledged compiler that can compile a Squaak program from source into
+Parrot Intermediate Representation (PIR) or run a Squaak program immediately.
+The compiler can also be used as an interactive interpreter, REPL, for Squaak.
+
+Squaak demonstrates some common language constructs,
+but is lacking some other, seemingly simple, features.
+For instance, our language will have no return, break or
continue statements (or equivalents in your favorite syntax).
-Squaak will have the following features:
+Squaak has the following features:
=over 4
@@ -92,20 +96,19 @@
=back
-=head2 The Compiler Tools
+=head2 The Tools
-The Parrot Compiler Tools we'll use to implement Squaak consist of the following
-parts:
+The Parrot Compiler Toolkit consists of the following tools:
=over 4
=item B<N>ot B<Q>uite B<P>erl (6) (NQP-rx).
-NQP is a lightweight language inspired by Perl 6 and can be used to write the
+NQP is a lightweight language inspired by Perl 6 which can be used to write the
methods that must be executed during the parsing phase, just as you can write
-actions in a Yacc/Bison input file. It also provides the regular expression engine we'll use to
+actions in a Yacc/Bison input file. It also provides the regular expression engine we'll use to
write our grammar. In addition to the capabilities of Perl 5's regexes, the Perl 6 regexes that NQP
- implements can be used to define language grammars. (Check the references for the specification.)
+implements can be used to define language grammars. (Check the references for the specification.)
=item B<P>arrot B<A>bstract B<S>yntax B<T>ree (PAST).
@@ -121,30 +124,33 @@
=head2 Getting Started
For this tutorial, it is assumed you have successfully compiled parrot
-(and maybe even run the test suite). If, after reading this tutorial, you feel like
-contributing to one of these languages, you can check out the mailing list or
+(and maybe even run the test suite).
+
+If, after reading this tutorial, you feel like
+contributing to one of the already implemented languages, you can check out the mailing list or
join IRC (see the references section for details).
-The languages subdirectory is the right spot to put our language implementation.
-Parrot comes with a special shell script to generate the necessary files for a
-language implementation. In order to generate these files for our language,
-type (assuming you're in Parrot's root directory):
+Parrot comes with a Perl 5 script that generates the necessary files for a
+language implementation. In order to generate these files for our sample language,
+go the Parrot's root directory and type:
$ perl tools/dev/mk_language_shell.pl Squaak ~/src/squaak
(Note: if you're on Windows, you should use backslashes.) This will generate the
-files in a directory F<~/src/squaak>, and use the name Squaak as the language's
-name.
+files in the directory F<~/src/squaak>. The name of the language will be Squaak.
After this, go to the directory F<~/src/squaak> and type:
$ parrot setup.pir test
-This will compile the generated files and run the test suite. If you want more
+This will compile the grammar and the actions and run the test suite.
+For running F<setup.pir> you can either use an installed parrot executable
+from your distribution or the one you have just compiled.
+
+If you want more
information on what files are being generated, please check out the references
at the end of this episode or read the documentation included in the file
-F<mk_language_shell.pl>. For that you can use an installed parrot executable
-from your distribution or one you have just compiled.
+F<tools/dev/mk_language_shell.pl>.
Note that we didn't write a single line of code, and already we have the basic
infrastructure in place to get us started. Of course, the generated compiler
@@ -267,7 +273,8 @@
=item * Perl 6/NQP rules syntax: Synopsis 5 at http://perlcabal.org/syn/S05.html or http://svn.pugscode.org/pugs/docs/Perl6/Spec/S05-regex.pod
-=back
+=item * List of HLL projects: http://trac.parrot.org/parrot/wiki/Languages
+=back
=cut
Modified: branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_2.pod
==============================================================================
--- branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_2.pod Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/examples/languages/squaak/doc/tutorial_episode_2.pod Mon Aug 16 00:44:30 2010 (r48518)
@@ -24,7 +24,7 @@
compiler enters the interactive mode. Consider the first case, passing the file
test.sq, just as we did before:
- $ ./installable_squeak test.sq
+ $ ./installable_squaak test.sq
When invoking our compiler like this, the file test.sq is compiled and the
generated code (bytecode) is executed immediately by Parrot. How does this work,
@@ -50,7 +50,7 @@
This is an example of using the target option set to "parse", which will print
the parse tree of the input to stdout:
- $ ./installable_squeak --target=parse test.sq
+ $ ./installable_squaak --target=parse test.sq
In interactive mode, giving this input:
@@ -235,9 +235,8 @@
=over 4
-=item 1. PIR language specification: docs/pdds/draft/PDD19_pir.pod
+=item 1. PIR language specification: docs/pdds/pdd19_pir.pod
=back
=cut
-
Modified: branches/unshared_buffers/examples/languages/squaak/setup.pir
==============================================================================
--- branches/unshared_buffers/examples/languages/squaak/setup.pir Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/examples/languages/squaak/setup.pir Mon Aug 16 00:44:30 2010 (r48518)
@@ -23,29 +23,6 @@
$S0 = shift args
load_bytecode 'distutils.pbc'
- .local int reqsvn
- $P0 = new 'FileHandle'
- $P0.'open'('PARROT_REVISION', 'r')
- $S0 = $P0.'readline'()
- reqsvn = $S0
- $P0.'close'()
-
- .local pmc config
- config = get_config()
- $I0 = config['revision']
- unless $I0 goto L1
- unless reqsvn > $I0 goto L1
- $S1 = "Parrot revision r"
- $S0 = reqsvn
- $S1 .= $S0
- $S1 .= " required (currently r"
- $S0 = $I0
- $S1 .= $S0
- $S1 .= ")\n"
- print $S1
- end
- L1:
-
$P0 = new 'Hash'
$P0['name'] = 'Squaak'
$P0['abstract'] = 'the Squaak compiler'
Modified: branches/unshared_buffers/include/parrot/namespace.h
==============================================================================
--- branches/unshared_buffers/include/parrot/namespace.h Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/include/parrot/namespace.h Mon Aug 16 00:44:30 2010 (r48518)
@@ -19,14 +19,6 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
-PMC * Parrot_find_global_s(PARROT_INTERP,
- ARGIN_NULLOK(STRING *str_key),
- ARGIN_NULLOK(STRING *globalname))
- __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
PMC * Parrot_ns_find_current_namespace_global(PARROT_INTERP,
ARGIN_NULLOK(STRING *globalname))
__attribute__nonnull__(1);
@@ -138,15 +130,6 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-PARROT_EXPORT
-void Parrot_store_global_s(PARROT_INTERP,
- ARGIN_NULLOK(STRING *str_key),
- ARGIN_NULLOK(STRING *globalname),
- ARGIN_NULLOK(PMC *val))
- __attribute__nonnull__(1);
-
-#define ASSERT_ARGS_Parrot_find_global_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_ns_find_current_namespace_global \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
@@ -192,8 +175,6 @@
#define ASSERT_ARGS_Parrot_ns_store_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(sub_pmc))
-#define ASSERT_ARGS_Parrot_store_global_s __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/namespace.c */
Modified: branches/unshared_buffers/include/parrot/pmc_freeze.h
==============================================================================
--- branches/unshared_buffers/include/parrot/pmc_freeze.h Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/include/parrot/pmc_freeze.h Mon Aug 16 00:44:30 2010 (r48518)
@@ -123,12 +123,14 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
-STRING * Parrot_freeze_pbc(PARROT_INTERP,
+opcode_t * Parrot_freeze_pbc(PARROT_INTERP,
ARGIN(PMC *pmc),
- ARGIN(const PackFile_ConstTable *pf))
+ ARGIN(const PackFile_ConstTable *pf),
+ ARGIN(opcode_t *cursor))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- __attribute__nonnull__(3);
+ __attribute__nonnull__(3)
+ __attribute__nonnull__(4);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
@@ -170,11 +172,12 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
PMC* Parrot_thaw_pbc(PARROT_INTERP,
- ARGIN(STRING *image),
- ARGIN(PackFile_ConstTable *pf))
+ ARGIN(PackFile_ConstTable *ct),
+ ARGMOD(const opcode_t **cursor))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- __attribute__nonnull__(3);
+ __attribute__nonnull__(3)
+ FUNC_MODIFIES(*cursor);
void Parrot_visit_loop_thawfinish(PARROT_INTERP, ARGIN(PMC *info))
__attribute__nonnull__(1)
@@ -193,7 +196,8 @@
#define ASSERT_ARGS_Parrot_freeze_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
- , PARROT_ASSERT_ARG(pf))
+ , PARROT_ASSERT_ARG(pf) \
+ , PARROT_ASSERT_ARG(cursor))
#define ASSERT_ARGS_Parrot_freeze_pbc_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
@@ -212,8 +216,8 @@
, PARROT_ASSERT_ARG(image))
#define ASSERT_ARGS_Parrot_thaw_pbc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(image) \
- , PARROT_ASSERT_ARG(pf))
+ , PARROT_ASSERT_ARG(ct) \
+ , PARROT_ASSERT_ARG(cursor))
#define ASSERT_ARGS_Parrot_visit_loop_thawfinish __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(info))
Modified: branches/unshared_buffers/include/parrot/pobj.h
==============================================================================
--- branches/unshared_buffers/include/parrot/pobj.h Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/include/parrot/pobj.h Mon Aug 16 00:44:30 2010 (r48518)
@@ -7,7 +7,7 @@
* Data Structure and Algorithms:
* History:
* Notes:
- * References: memory_internals.pod
+ * References: memory_internals.pod (out of date as of 8/2010).
*/
#ifndef PARROT_POBJ_H_GUARD
@@ -15,50 +15,59 @@
#include "parrot/config.h"
-/* Parrot Object - base class for all others */
+/* This is the base Parrot object structure. Every object begins with
+ this slot, then has additional slots as required. */
+
typedef struct pobj_t {
- Parrot_UInt flags;
+ Parrot_UInt flags; /* Lots of flags (see below). */
} PObj;
+/* This is a buffer header object, "inheriting" from PObj. */
+
typedef struct buffer_t {
Parrot_UInt flags;
- void * _bufstart;
- size_t _buflen;
+ void * _bufstart; /* Pointer to start of buffer data
+ (not buffer prolog). */
+ size_t _buflen; /* Length of buffer data. */
} Buffer;
+/* Use these macros to access the two buffer header slots. */
+
#define Buffer_bufstart(buffer) (buffer)->_bufstart
#define Buffer_buflen(buffer) (buffer)->_buflen
-/* See src/gc/alloc_resources.c. the basic idea is that buffer memory is
- set up as follows:
- +-----------------+
- | ref_count |f | # GC header
- obj->bufstart -> +-----------------+
- | data |
- v v
-
-The actual set-up is more involved because of padding. obj->bufstart must
-be suitably aligned. The start of the memory region (as returned by malloc())
-is suitably aligned for any use. If, for example, malloc() returns
-objects aligned on 8-byte boundaries, and obj->bufstart is also aligned
-on 8-byte boundaries, then there should be 4 bytes of padding.
-
-ptr from malloc -> +------------------+
- [other blocks?] |
- | INTVAL ref_count |
-obj->bufstart -> +------------------+
- | data |
- v v
-
+/* A buffer header object points to a buffer in a Memory_Block.
+ The buffer includes a prolog, but _bufstart points to the data
+ portion. Here is how it works:
+
+ Buffer header buffer
+ +-------------------+ +------------------------+
+ | flags | | (possible padding) | }
+ +-------------------+ +---------------------+--+ > prolog
+ | _bufstart | ------+ | *Memory_Block |fl| }
+ +-------------------+ | +---------------------+--+
+ | _buflen | +-------> | data portion |
+ +-------------------+ | |
+ ~ ~
+ | |
+ +------------------------+
+
+ The buffer prolog consists of possible padding and a pointer to the
+ Memory_Block containing the buffer. There are two flags in the low-order
+ bits of the pointer (see string.h). Padding is only required if the
+ alignment of the data portion is higher than that of a pointer.
+ This was not the case as of 8/2010.
*/
-/* Given a pointer to the buffer, find the ref_count and the actual start of
- the allocated space. Setting ref_count is clunky because we avoid lvalue
- casts. */
-#define Buffer_alloc_offset sizeof (void*)
-#define Buffer_bufallocstart(b) ((char *)Buffer_bufstart(b) - Buffer_alloc_offset)
-#define Buffer_pool(b) ((Memory_Block *)( *(INTVAL*)(Buffer_bufallocstart(b))))
-#define Buffer_poolptr(b) ((Memory_Block **)Buffer_bufallocstart(b))
+/* These macros let us address the prolog of a buffer. */
+
+#define Buffer_prolog_offset (sizeof (void*))
+#define Buffer_bufprolog(b) ((char *)Buffer_bufstart(b) - Buffer_prolog_offset)
+
+/* These macros give us the Memory_Block pointer and pointer-pointer. */
+
+#define Buffer_pool(b) ((Memory_Block *)( *(INTVAL*)(Buffer_bufprolog(b))))
+#define Buffer_poolptr(b) ((Memory_Block **)Buffer_bufprolog(b))
typedef enum {
@@ -68,28 +77,32 @@
enum_stringrep_four = 4
} parrot_string_representation_t;
+/* Here is the Parrot string header object, "inheriting" from Buffer. */
+
struct parrot_string_t {
Parrot_UInt flags;
void * _bufstart;
size_t _buflen;
- UINTVAL bufused;
- UINTVAL strlen;
- UINTVAL hashval; /* cached hash value computation */
+ UINTVAL bufused; /* Length of string in bytes. */
+ UINTVAL strlen; /* Length of string in characters. */
+ UINTVAL hashval; /* Cached hash value. */
/* parrot_string_representation_t representation;*/
- const struct _encoding *encoding;
- const struct _charset *charset;
+ const struct _encoding *encoding; /* Pointer to encoding structure. */
+ const struct _charset *charset; /* Pointer to charset structure. */
};
-/* note that cache and flags are isomorphic with Buffer and PObj */
-struct PMC {
- Parrot_UInt flags;
- VTABLE *vtable;
- DPOINTER *data;
+/* Here is the Parrot PMC object, "inheriting" from PObj. */
- PMC *_metadata; /* properties */
+struct PMC {
+ Parrot_UInt flags;
+ VTABLE *vtable; /* Pointer to vtable. */
+ DPOINTER *data; /* Pointer to attribute structure. */
+ PMC *_metadata; /* Pointer to metadata PMC. */
};
+/* Use these macros to access the data and metadata. */
+
#define PMC_data(pmc) (pmc)->data
#define PMC_data_typed(pmc, type) (type)(pmc)->data
#define PMC_metadata(pmc) ((pmc)->_metadata)
Modified: branches/unshared_buffers/runtime/parrot/library/HTTP/Message.pir
==============================================================================
--- branches/unshared_buffers/runtime/parrot/library/HTTP/Message.pir Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/runtime/parrot/library/HTTP/Message.pir Mon Aug 16 00:44:30 2010 (r48518)
@@ -20,7 +20,6 @@
.namespace ['HTTP';'Date']
-.loadlib 'io_ops' # XXX avoids segfaults for some reason (see TT #1663)
.loadlib 'sys_ops'
.include 'tm.pasm'
Modified: branches/unshared_buffers/runtime/parrot/library/distutils.pir
==============================================================================
--- branches/unshared_buffers/runtime/parrot/library/distutils.pir Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/runtime/parrot/library/distutils.pir Mon Aug 16 00:44:30 2010 (r48518)
@@ -201,7 +201,6 @@
=cut
-.loadlib 'io_ops' # workaround TT #1663
.loadlib 'sys_ops'
.sub '__onload' :load :init :anon
Modified: branches/unshared_buffers/src/call/args.c
==============================================================================
--- branches/unshared_buffers/src/call/args.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/call/args.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -1368,10 +1368,30 @@
const char *x;
INTVAL flags = 0;
INTVAL set = 0;
+ INTVAL count = 0;
+
+ for (x = signature; *x; ++x) {
+ if (*x == '-')
+ break;
+ switch (*x) {
+ case 'I': count++; break;
+ case 'N': count++; break;
+ case 'S': count++; break;
+ case 'P': count++; break;
+ default: break;
+ }
+ }
if (PMC_IS_NULL(*arg_flags))
- *arg_flags = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
- current_array = *arg_flags;
+ current_array = *arg_flags
+ = Parrot_pmc_new_init_int(interp,
+ enum_class_ResizableIntegerArray, count);
+ else {
+ current_array = *arg_flags;
+ VTABLE_set_integer_native(interp, current_array, count);
+ }
+
+ count = 0;
for (x = signature; *x != '\0'; ++x) {
@@ -1384,7 +1404,7 @@
/* Starting a new argument, so store the previous argument,
* if there was one. */
if (set) {
- VTABLE_push_integer(interp, current_array, flags);
+ VTABLE_set_integer_keyed_int(interp, current_array, count++, flags);
set = 0;
}
@@ -1421,7 +1441,7 @@
/* Store the final argument, if there was one. */
if (set)
- VTABLE_push_integer(interp, current_array, flags);
+ VTABLE_set_integer_keyed_int(interp, current_array, count, flags);
}
/*
Modified: branches/unshared_buffers/src/gc/alloc_resources.c
==============================================================================
--- branches/unshared_buffers/src/gc/alloc_resources.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/gc/alloc_resources.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -291,18 +291,8 @@
- reduce alignment to a reasonable value i.e. MALLOC_ALIGNMENT
aka 2*sizeof (size_t) or just 8 (TODO make a config hint)
-Buffer memory layout:
-
- +-------------------+
- | flags # GC header |
- obj->bufstart -> +-------------------+
- | data |
- v v
-
- * if PObj_is_COWable is set, then we have space for flags.
-
- * if PObj_align_FLAG is set, obj->bufstart is aligned like discussed above
- * obj->buflen is the usable length excluding the optional GC part.
+See pobj.h for a discussion of the Buffer descriptor and the buffer itself,
+including its header.
=cut
@@ -331,8 +321,11 @@
* TODO pass required allocation size to the GC system,
* so that collection can be skipped if needed
*/
+ size_t new_mem = mem_pools->memory_used -
+ mem_pools->mem_used_last_collect;
if (!mem_pools->gc_mark_block_level
- && mem_pools->mem_allocs_since_last_collect) {
+ && new_mem > (mem_pools->mem_used_last_collect >> 1)
+ && new_mem > GC_SIZE_THRESHOLD) {
Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
}
if (pool->top_block->free < size) {
@@ -359,6 +352,7 @@
return_val = pool->top_block->top;
pool->top_block->top += size;
pool->top_block->free -= size;
+ mem_pools->memory_used += size;
return return_val;
}
@@ -453,6 +447,8 @@
if (mem_pools->gc_sweep_block_level)
return;
+ ++mem_pools->gc_collect_runs;
+
/* Snag a block big enough for everything */
total_size = pad_pool_size(pool);
@@ -464,7 +460,6 @@
/* We're collecting */
mem_pools->mem_allocs_since_last_collect = 0;
mem_pools->header_allocs_since_last_collect = 0;
- ++mem_pools->gc_collect_runs;
alloc_new_block(mem_pools, total_size, pool, "inside compact");
@@ -520,6 +515,7 @@
/* How much is free. That's the total size minus the amount we used */
new_block->free = new_block->size - (cur_spot - new_block->start);
mem_pools->memory_collected += (cur_spot - new_block->start);
+ mem_pools->memory_used += (cur_spot - new_block->start);
--mem_pools->gc_sweep_block_level;
}
@@ -682,6 +678,8 @@
else {
/* Note that we don't have it any more */
mem_pools->memory_allocated -= cur_block->size;
+ mem_pools->memory_used -=
+ cur_block->size - cur_block->free - cur_block->freed;
/* We know the pool body and pool header are a single chunk, so
* this is enough to get rid of 'em both */
Modified: branches/unshared_buffers/src/gc/gc_ms.c
==============================================================================
--- branches/unshared_buffers/src/gc/gc_ms.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/gc/gc_ms.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -35,11 +35,13 @@
__attribute__nonnull__(1);
static void gc_ms_add_free_object(SHIM_INTERP,
- SHIM(Memory_Pools *mem_pools),
+ ARGMOD(Memory_Pools *mem_pools),
ARGMOD(Fixed_Size_Pool *pool),
ARGIN(void *to_add))
+ __attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
+ FUNC_MODIFIES(*mem_pools)
FUNC_MODIFIES(*pool);
static void gc_ms_alloc_objects(PARROT_INTERP,
@@ -134,11 +136,12 @@
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static void * gc_ms_get_free_object(PARROT_INTERP,
- ARGIN(Memory_Pools *mem_pools),
+ ARGMOD(Memory_Pools *mem_pools),
ARGMOD(Fixed_Size_Pool *pool))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
+ FUNC_MODIFIES(*mem_pools)
FUNC_MODIFIES(*pool);
static size_t gc_ms_get_gc_info(PARROT_INTERP, Interpinfo_enum which)
@@ -253,7 +256,8 @@
#define ASSERT_ARGS_gc_ms_active_sized_buffers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(mem_pools))
#define ASSERT_ARGS_gc_ms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(pool) \
+ PARROT_ASSERT_ARG(mem_pools) \
+ , PARROT_ASSERT_ARG(pool) \
, PARROT_ASSERT_ARG(to_add))
#define ASSERT_ARGS_gc_ms_alloc_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
@@ -560,6 +564,7 @@
++mem_pools->gc_mark_runs;
--mem_pools->gc_mark_block_level;
mem_pools->header_allocs_since_last_collect = 0;
+ mem_pools->mem_used_last_collect = mem_pools->memory_used;
return;
}
@@ -1098,6 +1103,7 @@
&& (pool->top_block->top == (char *)Buffer_bufstart(buffer) + old_size)) {
pool->top_block->free -= needed;
pool->top_block->top += needed;
+ interp->mem_pools->memory_used += needed;
Buffer_buflen(buffer) = newsize;
return;
}
@@ -1210,6 +1216,7 @@
&& pool->top_block->top == (char *)Buffer_bufstart(str) + old_size) {
pool->top_block->free -= needed;
pool->top_block->top += needed;
+ interp->mem_pools->memory_used += needed;
Buffer_buflen(str) = new_size - sizeof (void *);
return;
}
@@ -1228,7 +1235,8 @@
/* Decrease usage */
PARROT_ASSERT(Buffer_pool(str));
- Buffer_pool(str)->freed += ALIGNED_STRING_SIZE(Buffer_buflen(str));
+ Buffer_pool(str)->freed += old_size;
+ interp->mem_pools->memory_used -= old_size;
oldmem = Buffer_bufstart(str);
Buffer_bufstart(str) = (void *)mem;
@@ -1489,12 +1497,15 @@
ARGMOD(Fixed_Size_Pool *pool))
{
ASSERT_ARGS(gc_ms_more_traceable_objects)
+ size_t new_mem = mem_pools->memory_used
+ - mem_pools->mem_used_last_collect;
if (pool->skip == GC_ONE_SKIP)
pool->skip = GC_NO_SKIP;
else if (pool->skip == GC_NEVER_SKIP
|| (pool->skip == GC_NO_SKIP
- && mem_pools->header_allocs_since_last_collect >= GC_SIZE_THRESHOLD))
+ && (new_mem > (mem_pools->mem_used_last_collect >> 1)
+ && mem_pools->header_allocs_since_last_collect >= GC_SIZE_THRESHOLD)))
Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
/* requires that num_free_objects be updated in Parrot_gc_mark_and_sweep.
@@ -1518,7 +1529,7 @@
static void
gc_ms_add_free_object(SHIM_INTERP,
- SHIM(Memory_Pools *mem_pools),
+ ARGMOD(Memory_Pools *mem_pools),
ARGMOD(Fixed_Size_Pool *pool),
ARGIN(void *to_add))
{
@@ -1529,6 +1540,7 @@
object->next_ptr = pool->free_list;
pool->free_list = object;
+ mem_pools->memory_used -= pool->object_size;
}
/*
@@ -1549,7 +1561,7 @@
PARROT_WARN_UNUSED_RESULT
static void *
gc_ms_get_free_object(PARROT_INTERP,
- ARGIN(Memory_Pools *mem_pools),
+ ARGMOD(Memory_Pools *mem_pools),
ARGMOD(Fixed_Size_Pool *pool))
{
ASSERT_ARGS(gc_ms_get_free_object)
@@ -1579,6 +1591,7 @@
}
--pool->num_free_objects;
+ mem_pools->memory_used += pool->object_size;
return ptr;
}
Modified: branches/unshared_buffers/src/gc/gc_private.h
==============================================================================
--- branches/unshared_buffers/src/gc/gc_private.h Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/gc/gc_private.h Mon Aug 16 00:44:30 2010 (r48518)
@@ -71,6 +71,7 @@
larger then sizeof(PObj), thus creating overflow. However PObjs are never
used by themselves, things like PMCs and STRINGs are cast to PObj in the
GC, so we should have plenty of space. */
+
typedef struct GC_MS_PObj_Wrapper {
size_t flags;
struct GC_MS_PObj_Wrapper * next_ptr;
@@ -158,84 +159,113 @@
*/
} GC_Subsystem;
-typedef struct Memory_Block {
- size_t free;
- size_t size;
- struct Memory_Block *prev;
- struct Memory_Block *next;
- char *start;
- char *top;
+/* This header structure describes a block of memory that is part of a
+ variable-size pool. The allocatable memory follows the header. */
- /* Amount of freed memory. Used in compact_pool */
- size_t freed;
+typedef struct Memory_Block {
+ size_t free; /* Remaining free space. */
+ size_t size; /* Size of memory. */
+ struct Memory_Block *prev; /* Pointer to previous block. */
+ struct Memory_Block *next; /* Pointer to next block. */
+ char *start; /* Pointer to start of memory. */
+ char *top; /* Pointer to free space in memory. */
+ size_t freed; /* Amount of freed memory.
+ Used in compact_pool */
} Memory_Block;
+/* This structure describes a variable-size memory pool. Various such pools
+ hang off the Memory_Pools root structure. */
+
typedef struct Variable_Size_Pool {
- Memory_Block *top_block;
- void (*compact)(PARROT_INTERP, struct Memory_Pools *, struct Variable_Size_Pool *);
- size_t minimum_block_size;
- size_t total_allocated; /* total bytes allocated to this pool */
+ Memory_Block *top_block; /* Pointer to most recent memory block. */
+ /* Pool compactor, or NULL. */
+ void (*compact)(PARROT_INTERP, struct Memory_Pools *,
+ struct Variable_Size_Pool *);
+ size_t minimum_block_size; /* Minimum allocation size, to
+ prevent fragmentation. */
+ size_t total_allocated; /* Total bytes allocated to this pool. */
} Variable_Size_Pool;
+/* This header structure describes an arena: a block of memory that is part of a
+ fixed-sized pool. The arena has enough memory for 'total_objects' objects
+ of a particular size specified in the pool. */
+
typedef struct Fixed_Size_Arena {
- size_t used;
- size_t total_objects;
- struct Fixed_Size_Arena *prev;
- struct Fixed_Size_Arena *next;
- void *start_objects;
+ size_t used; /* Number of objects slots used. */
+ size_t total_objects; /* Total number of object slots. */
+ struct Fixed_Size_Arena *prev; /* Pointer to previous arena. */
+ struct Fixed_Size_Arena *next; /* Pointer to next arena. */
+ void *start_objects; /* Pointer to arena memory. */
} Fixed_Size_Arena;
+/* This simple header structure describes a free PMC attribute object.
+ A list of them hang off the PMC attribute pool. */
+
typedef struct PMC_Attribute_Free_List {
- struct PMC_Attribute_Free_List * next;
+ struct PMC_Attribute_Free_List * next; /* Pointer to next free object. */
} PMC_Attribute_Free_List;
+/* This header structure describes a PMC attribute arena: A block of memory
+ that is part of a PMC attribute pool. The allocatable memory follows
+ this header. */
+
typedef struct PMC_Attribute_Arena {
- struct PMC_Attribute_Arena * next;
- struct PMC_Attribute_Arena * prev;
+ struct PMC_Attribute_Arena * next; /* Pointer to next arena. */
+ struct PMC_Attribute_Arena * prev; /* Pointer to previous arena. */
} PMC_Attribute_Arena;
+/* This structure describes a PMC attribute pool. A vector of them hang
+ off the Memory_Pools root structure. */
+
typedef struct PMC_Attribute_Pool {
- size_t attr_size;
- size_t total_objects;
- size_t objects_per_alloc;
- size_t num_free_objects;
- PMC_Attribute_Arena *top_arena;
- PMC_Attribute_Free_List *free_list;
- PMC_Attribute_Free_List *newfree;
- PMC_Attribute_Free_List *newlast;
+ size_t attr_size; /* Size of attribute object. */
+ size_t total_objects; /* Total objects in the pool. */
+ size_t objects_per_alloc; /* Number of object slots to allocate. */
+ size_t num_free_objects; /* Number of objects on the free list. */
+ PMC_Attribute_Free_List * free_list; /* List of free object slots, or NULL. */
+ PMC_Attribute_Arena * top_arena; /* Pointer to most recent arena. */
+ PMC_Attribute_Free_List * newfree; /* Pointer to next object slot in
+ latest arena, or NULL (slots weren't
+ put on free list). */
+ PMC_Attribute_Free_List * newlast; /* High water mark in arena. */
+
} PMC_Attribute_Pool;
-/* Tracked resource pool */
+/* This structure describes a fixed-size memory pool. Various such pools
+ hang off the Memory_Pools root structure. */
+
typedef struct Fixed_Size_Pool {
- struct Variable_Size_Pool *mem_pool;
- /* Size in bytes of an individual pool item. This size may include
- * a GC-system specific GC header. */
- size_t object_size;
-
- size_t start_arena_memory;
- size_t end_arena_memory;
-
- Fixed_Size_Arena *last_Arena;
- GC_MS_PObj_Wrapper * free_list;
- size_t num_free_objects; /* number of resources in the free pool */
- size_t total_objects;
-
- PARROT_OBSERVER const char *name;
-
- size_t objects_per_alloc;
-
- int skip;
- size_t replenish_level;
-
- add_free_object_fn_type add_free_object; /* adds a free object to
- the pool's free list */
- get_free_object_fn_type get_free_object; /* gets and removes a free
- object from the pool's
- free list */
- alloc_objects_fn_type alloc_objects; /* allocates more objects */
- alloc_objects_fn_type more_objects;
- gc_object_fn_type gc_object;
+ struct Variable_Size_Pool *mem_pool; /* Pointer to associated variable-size
+ pool, or NULL. */
+ size_t object_size; /* Size in bytes of an individual pool
+ object. This size may include
+ a GC system-specific GC header. */
+
+ size_t start_arena_memory; /* Address of the lowest arena. */
+ size_t end_arena_memory; /* And the highest one. */
+
+ Fixed_Size_Arena *last_Arena; /* Pointer to most recent arena. */
+ GC_MS_PObj_Wrapper * free_list; /* List of free object slots, or NULL. */
+ size_t num_free_objects; /* Number of objects on the free list. */
+ size_t total_objects; /* Total objects in the pool. */
+
+ PARROT_OBSERVER const char *name; /* Name of pool. */
+
+ size_t objects_per_alloc; /* Number of object slots to allocate. */
+
+ int skip; /* How often to skip full GC
+ (see gc_skip_type_enum). */
+ size_t replenish_level; /* Replenish pool when free object slots
+ goes below this level. */
+
+ add_free_object_fn_type add_free_object; /* Adds a free object to
+ the pool's free list */
+ get_free_object_fn_type get_free_object; /* Gets and removes a free object
+ from the pool's free list. */
+ alloc_objects_fn_type alloc_objects; /* Allocates an arena for objects. */
+ alloc_objects_fn_type more_objects; /* Obtain more free objects. */
+ gc_object_fn_type gc_object; /* GCs object during sweep. */
/* Contains GC system-specific data structures ... unused at the moment,
* but this is where it should go when we need it ...
@@ -243,24 +273,37 @@
} gc_private;
*/
- void *newfree;
- void *newlast;
+ void *newfree; /* Pointer to next object slot in
+ latest arena, or NULL (slots weren't
+ put on free list). */
+ void *newlast; /* High water mark in arena. */
+
} Fixed_Size_Pool;
-typedef struct Memory_Pools {
- Variable_Size_Pool *memory_pool;
- Variable_Size_Pool *constant_string_pool;
- Fixed_Size_Pool *string_header_pool;
- Fixed_Size_Pool *pmc_pool;
- Fixed_Size_Pool *constant_pmc_pool;
- Fixed_Size_Pool *constant_string_header_pool;
- Fixed_Size_Pool **sized_header_pools;
- size_t num_sized;
+/* This structure acts as the root for all the various memory pools:
+ variable-sized, fixed-size, and PMC attributes. It also contains
+ various GC-related items. It hangs off the Interp structure. */
- PMC_Attribute_Pool **attrib_pools;
- size_t num_attribs;
+typedef struct Memory_Pools {
+ /* Pointers to pools */
+ Variable_Size_Pool *memory_pool; /* General memory pool. */
+ Variable_Size_Pool *constant_string_pool; /* Constant string pool (not
+ compacted). */
+ Fixed_Size_Pool *string_header_pool; /* String header pool. */
+ Fixed_Size_Pool *pmc_pool; /* PMC object pool. */
+ Fixed_Size_Pool *constant_pmc_pool; /* And one for constant PMCs. */
+ Fixed_Size_Pool *constant_string_header_pool; /* And a constant string
+ header pool. */
+
+ Fixed_Size_Pool **sized_header_pools; /* Vector of pools for other
+ fixed-size headers. */
+ size_t num_sized; /* Length of that vector. */
+
+ PMC_Attribute_Pool **attrib_pools; /* Vector of pools for PMC
+ attributes. */
+ size_t num_attribs; /* Length of that vector. */
- /** statistics for GC **/
+ /* statistics for GC */
size_t gc_mark_runs; /* Number of times we've done a mark run */
size_t gc_lazy_mark_runs; /* Number of successful lazy mark runs */
size_t gc_collect_runs; /* Number of times we've done a memory
@@ -273,12 +316,16 @@
* blocks allocated from
* the system since the last
* GC run */
- size_t memory_allocated; /* The total amount of
- * allocatable memory
- * allocated. Doesn't count
- * memory for headers or
- * internal structures or
+ size_t memory_allocated; /* The total amount of allocatable memory
+ * allocated. Doesn't count memory for
+ * headers or internal structures or
* anything */
+ size_t memory_used; /* The total amount of
+ * memory used for
+ * buffers and headers */
+ size_t mem_used_last_collect; /* The total amount of
+ * memory used after
+ * the last GC run */
UINTVAL memory_collected; /* Total amount of memory copied
during collection */
UINTVAL num_early_gc_PMCs; /* how many PMCs want immediate destruction */
@@ -296,7 +343,7 @@
requests are there? */
/* private data for the GC subsystem */
- void *gc_private; /* gc subsystem data */
+ void *gc_private; /* GC subsystem data */
} Memory_Pools;
/* HEADERIZER BEGIN: src/gc/system.c */
@@ -337,7 +384,7 @@
ARGMOD(Memory_Pools *mem_pools),
int flag,
ARGIN_NULLOK(void *arg),
- NOTNULL(pool_iter_fn func))
+ NOTNULL(const pool_iter_fn func))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(5)
Modified: branches/unshared_buffers/src/gc/mark_sweep.c
==============================================================================
--- branches/unshared_buffers/src/gc/mark_sweep.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/gc/mark_sweep.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -32,11 +32,13 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
static void free_buffer(SHIM_INTERP,
- SHIM(Memory_Pools *mem_pools),
+ ARGMOD(Memory_Pools *mem_pools),
ARGMOD(Fixed_Size_Pool *pool),
ARGMOD(Buffer *b))
+ __attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
+ FUNC_MODIFIES(*mem_pools)
FUNC_MODIFIES(*pool)
FUNC_MODIFIES(*b);
@@ -78,7 +80,8 @@
FUNC_MODIFIES(*mem_pools);
#define ASSERT_ARGS_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(pool) \
+ PARROT_ASSERT_ARG(mem_pools) \
+ , PARROT_ASSERT_ARG(pool) \
, PARROT_ASSERT_ARG(b))
#define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
@@ -655,7 +658,7 @@
static void
free_buffer(SHIM_INTERP,
- SHIM(Memory_Pools *mem_pools),
+ ARGMOD(Memory_Pools *mem_pools),
ARGMOD(Fixed_Size_Pool *pool),
ARGMOD(Buffer *b))
{
@@ -781,7 +784,7 @@
/*
=item C<int header_pools_iterate_callback(PARROT_INTERP, Memory_Pools
-*mem_pools, int flag, void *arg, pool_iter_fn func)>
+*mem_pools, int flag, void *arg, const pool_iter_fn func)>
Iterates through header pools, invoking the given callback function on each
pool in the list matching the given criteria. Determines which pools to iterate
@@ -823,7 +826,7 @@
header_pools_iterate_callback(PARROT_INTERP,
ARGMOD(Memory_Pools *mem_pools),
int flag, ARGIN_NULLOK(void *arg),
- NOTNULL(pool_iter_fn func))
+ NOTNULL(const pool_iter_fn func))
{
ASSERT_ARGS(header_pools_iterate_callback)
Modified: branches/unshared_buffers/src/hll.c
==============================================================================
--- branches/unshared_buffers/src/hll.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/hll.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -364,8 +364,6 @@
Parrot_get_HLL_type(PARROT_INTERP, INTVAL hll_id, INTVAL core_type)
{
ASSERT_ARGS(Parrot_get_HLL_type)
- PMC *entry, *type_hash, *hll_info;
- INTVAL n, id;
if (hll_id == PARROT_HLL_NONE || hll_id == 0)
return core_type;
@@ -373,26 +371,28 @@
if (hll_id < 0)
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_GLOBAL_NOT_FOUND,
"no such HLL ID (%vd)", hll_id);
+ else {
+ PMC * const hll_info = interp->HLL_info;
+ INTVAL id;
+ PMC *entry, *type_hash;
- hll_info = interp->HLL_info;
- n = VTABLE_elements(interp, hll_info);
+ START_READ_HLL_INFO(interp, hll_info);
+ entry = VTABLE_get_pmc_keyed_int(interp, hll_info, hll_id);
+ END_READ_HLL_INFO(interp, hll_info);
- if (hll_id >= n)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_GLOBAL_NOT_FOUND,
- "no such HLL ID (%vd)", hll_id);
-
- START_READ_HLL_INFO(interp, hll_info);
- entry = VTABLE_get_pmc_keyed_int(interp, hll_info, hll_id);
- END_READ_HLL_INFO(interp, hll_info);
+ if (PMC_IS_NULL(entry))
+ Parrot_ex_throw_from_c_args(interp, NULL,
+ EXCEPTION_GLOBAL_NOT_FOUND, "no such HLL ID (%vd)", hll_id);
- type_hash = VTABLE_get_pmc_keyed_int(interp, entry, e_HLL_typemap);
+ type_hash = VTABLE_get_pmc_keyed_int(interp, entry, e_HLL_typemap);
- if (PMC_IS_NULL(type_hash))
- return core_type;
+ if (PMC_IS_NULL(type_hash))
+ return core_type;
- id = VTABLE_get_integer_keyed_int(interp, type_hash, core_type);
+ id = VTABLE_get_integer_keyed_int(interp, type_hash, core_type);
- return id ? id : core_type;
+ return id ? id : core_type;
+ }
}
/*
@@ -412,6 +412,8 @@
{
ASSERT_ARGS(Parrot_get_ctx_HLL_type)
const INTVAL hll_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
+ if (!hll_id || hll_id == PARROT_HLL_NONE)
+ return core_type;
return Parrot_get_HLL_type(interp, hll_id, core_type);
}
Modified: branches/unshared_buffers/src/namespace.c
==============================================================================
--- branches/unshared_buffers/src/namespace.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/namespace.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -607,35 +607,6 @@
/*
-=item C<PMC * Parrot_find_global_s(PARROT_INTERP, STRING *str_key, STRING
-*globalname)>
-
-Search the namespace designated by C<str_key>, or the HLL root if
-C<str_key> is NULL, for an object with name C<globalname>. Return the
-object, or NULL if not found.
-
-TT #1222 - For now this function prefers non-namespaces, it will eventually
-entirely use the untyped interface.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-PMC *
-Parrot_find_global_s(PARROT_INTERP, ARGIN_NULLOK(STRING *str_key),
- ARGIN_NULLOK(STRING *globalname))
-{
- ASSERT_ARGS(Parrot_find_global_s)
- PMC * const hll_ns = Parrot_get_ctx_HLL_namespace(interp);
- PMC * const ns = Parrot_ns_get_namespace_keyed_str(interp, hll_ns, str_key);
- return Parrot_ns_find_namespace_global(interp, ns, globalname);
-}
-
-/*
-
=item C<void Parrot_ns_store_global(PARROT_INTERP, PMC *ns, STRING *globalname,
PMC *val)>
@@ -661,33 +632,6 @@
/*
-=item C<void Parrot_store_global_s(PARROT_INTERP, STRING *str_key, STRING
-*globalname, PMC *val)>
-
-Store the PMC C<val> into the namespace designated by C<str_key>, or
-the HLL root if C<str_key> is NULL, with the name C<globalname>.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_store_global_s(PARROT_INTERP, ARGIN_NULLOK(STRING *str_key),
- ARGIN_NULLOK(STRING *globalname), ARGIN_NULLOK(PMC *val))
-{
- ASSERT_ARGS(Parrot_store_global_s)
- PMC * const hll_ns = Parrot_get_ctx_HLL_namespace(interp);
- PMC * const ns = Parrot_ns_make_namespace_keyed_str(interp, hll_ns, str_key);
- Parrot_ns_store_global(interp, ns, globalname, val);
-
- /* TT #1225 - method cache invalidation should be a namespace function */
- Parrot_invalidate_method_cache(interp, str_key);
-}
-
-
-/*
-
=item C<PMC * Parrot_ns_find_global_from_op(PARROT_INTERP, PMC *ns, STRING
*globalname, void *next)>
Modified: branches/unshared_buffers/src/ops/core.ops
==============================================================================
--- branches/unshared_buffers/src/ops/core.ops Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/ops/core.ops Mon Aug 16 00:44:30 2010 (r48518)
@@ -1009,19 +1009,22 @@
=item .PARROT_ERRORS_GLOBALS_FLAG
-Throw an exception if global doesn't exist. Default: on.
+Throw an exception if a global doesn't exist. This
+flag is not used by Parrot and is deprecated.
=item .PARROT_ERRORS_OVERFLOW_FLAG
-Throw math overflow instead of promoting to BigInt. Default: off.
+When performing arithmetic on Integer PMCs, throw a math overflow exception
+instead of promoting to BigInt. This flag does not pertain to native integers,
+which are never promoted. Default: off.
=item .PARROT_ERRORS_PARAM_COUNT_FLAG
-Throw exception on argument <-> param count mismatch. Default: off.
+Throw an exception on an argument versus parameter count mismatch. Default: on.
=item .PARROT_ERRORS_RESULT_COUNT_FLAG
-Throw exception on return <-> result count mismatch. Default: off.
+Throw an exception on a return versus result count mismatch. Default: off.
=item .PARROT_ERRORS_ALL_FLAG
Modified: branches/unshared_buffers/src/packfile.c
==============================================================================
--- branches/unshared_buffers/src/packfile.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/packfile.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -4154,15 +4154,12 @@
ASSERT_ARGS(PackFile_Constant_unpack_pmc)
PackFile * const pf = constt->base.pf;
STRING *_sub = CONST_STRING(interp, "Sub");
- STRING *image;
PMC *pmc;
/* thawing the PMC needs the real packfile in place */
PackFile_ByteCode * const cs_save = interp->code;
interp->code = pf->cur_cs;
- image = PF_fetch_buf(interp, pf, &cursor);
-
- pmc = Parrot_thaw_pbc(interp, image, constt);
+ pmc = Parrot_thaw_pbc(interp, constt, &cursor);
/* place item in const_table */
self->type = PFC_PMC;
Modified: branches/unshared_buffers/src/packout.c
==============================================================================
--- branches/unshared_buffers/src/packout.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/packout.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -361,9 +361,7 @@
break;
case PFC_PMC:
- key = self->u.key; /* the (Sub) PMC */
- image = Parrot_freeze_pbc(interp, key, const_table);
- cursor = PF_store_buf(cursor, image);
+ cursor = Parrot_freeze_pbc(interp, self->u.key, const_table, cursor);
break;
case PFC_KEY:
Modified: branches/unshared_buffers/src/pmc/bigint.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/bigint.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/bigint.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -388,8 +388,6 @@
=item C<static void bigint_init(PARROT_INTERP, PMC *self)>
-
-
=cut
*/
@@ -408,8 +406,6 @@
=item C<static void bigint_clear(PARROT_INTERP, PMC *self)>
-
-
=cut
*/
@@ -429,8 +425,6 @@
=item C<static void bigint_set(PARROT_INTERP, PMC *dest, PMC *src)>
-
-
=cut
*/
@@ -491,9 +485,8 @@
/*
-=item C<static void bigint_set_str(PARROT_INTERP, PMC *self, const char *value, int base)>
-
-
+=item C<static void bigint_set_str(PARROT_INTERP, PMC *self, const char *value,
+int base)>
=cut
@@ -513,8 +506,6 @@
=item C<static BIGINT* bigint_get_self(PARROT_INTERP, PMC *self)>
-
-
=cut
*/
@@ -535,8 +526,6 @@
=item C<static void bigint_set_self(PARROT_INTERP, PMC *self, BIGINT *value)>
-
-
=cut
*/
@@ -555,8 +544,6 @@
=item C<static long bigint_get_long(PARROT_INTERP, PMC *self)>
-
-
=cut
*/
@@ -579,7 +566,6 @@
=item C<static int bigint_get_bool(PARROT_INTERP, PMC *self)>
-
=cut
*/
@@ -602,7 +588,6 @@
=item C<static char * bigint_get_string(PARROT_INTERP, PMC *self, int base)>
-
=cut
*/
@@ -628,7 +613,6 @@
=item C<static double bigint_get_double(PARROT_INTERP, PMC *self)>
-
=cut
*/
@@ -647,9 +631,8 @@
/*
-=item C<static void bigint_add_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC *dest)>
-
-
+=item C<static void bigint_add_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC
+*dest)>
=cut
@@ -669,10 +652,8 @@
/*
-=item C<static void bigint_add_bigint_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)>
-
-
-
+=item C<static void bigint_add_bigint_int(PARROT_INTERP, PMC *self, INTVAL
+value, PMC *dest)>
=cut
@@ -694,9 +675,8 @@
/*
-=item C<static void bigint_sub_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC *dest)>
-
-
+=item C<static void bigint_sub_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC
+*dest)>
=cut
@@ -716,7 +696,8 @@
/*
-=item C<static void bigint_sub_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC *dest)>
+=item C<static void bigint_sub_bigint_int(PARROT_INTERP, PMC *self, INTVAL
+value, PMC *dest)>
=cut
@@ -739,9 +720,8 @@
/*
-=item C<static void bigint_mul_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC *dest)>
-
-
+=item C<static void bigint_mul_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC
+*dest)>
=cut
@@ -761,9 +741,8 @@
/*
-=item C<static void bigint_mul_bigint_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)>
-
-
+=item C<static void bigint_mul_bigint_int(PARROT_INTERP, PMC *self, INTVAL
+value, PMC *dest)>
=cut
@@ -782,9 +761,8 @@
/*
-=item C<static void bigint_pow_bigint_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)>
-
-
+=item C<static void bigint_pow_bigint_int(PARROT_INTERP, PMC *self, INTVAL
+value, PMC *dest)>
=cut
@@ -805,7 +783,6 @@
=item C<static void int_check_divide_zero(PARROT_INTERP, INTVAL value)>
-
=cut
*/
@@ -822,7 +799,6 @@
=item C<static void bigint_check_divide_zero(PARROT_INTERP, PMC *value)>
-
=cut
*/
@@ -842,9 +818,8 @@
/*
-=item C<static void bigint_div_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC *dest)>
-
-
+=item C<static void bigint_div_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC
+*dest)>
=cut
@@ -866,9 +841,8 @@
/*
-=item C<static void bigint_div_bigint_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)>
-
-
+=item C<static void bigint_div_bigint_int(PARROT_INTERP, PMC *self, INTVAL
+value, PMC *dest)>
=cut
@@ -895,9 +869,8 @@
/*
-=item C<static void bigint_fdiv_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC *dest)>
-
-
+=item C<static void bigint_fdiv_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC
+*dest)>
=cut
@@ -918,9 +891,8 @@
/*
-=item C<static void bigint_fdiv_bigint_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)>
-
-
+=item C<static void bigint_fdiv_bigint_int(PARROT_INTERP, PMC *self, INTVAL
+value, PMC *dest)>
=cut
@@ -946,8 +918,8 @@
/*
-=item C<static void bigint_mod_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC *dest)>
-
+=item C<static void bigint_mod_bigint(PARROT_INTERP, PMC *self, PMC *value, PMC
+*dest)>
=cut
@@ -968,9 +940,8 @@
/*
-=item C<static void bigint_mod_bigint_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)>
-
-
+=item C<static void bigint_mod_bigint_int(PARROT_INTERP, PMC *self, INTVAL
+value, PMC *dest)>
=cut
@@ -997,7 +968,6 @@
=item C<static INTVAL bigint_cmp(PARROT_INTERP, PMC *self, PMC *value)>
-
=cut
*/
@@ -1018,8 +988,6 @@
=item C<static INTVAL bigint_cmp_int(PARROT_INTERP, PMC *self, INTVAL value)>
-
-
=cut
*/
@@ -1039,8 +1007,6 @@
=item C<static void bigint_abs(PARROT_INTERP, PMC *self, PMC *dest)>
-
-
=cut
*/
@@ -1060,8 +1026,6 @@
=item C<static void bigint_neg(PARROT_INTERP, PMC *self, PMC *dest)>
-
-
=cut
*/
Modified: branches/unshared_buffers/src/pmc/bignum.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/bignum.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/bignum.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -148,6 +148,15 @@
=item C<static void bignum_set_default_prec(PARROT_INTERP, PMC *self, INTVAL
prec)>
+All the above functions are local to the bignum pmc and are there to provide
+interface functions to The GNU MP Bignum Library (GMP)
+
+If GMP is not available, at present these functions will throw a NYI exception.
+
+(It would be appreciated if maintainers/implementors could improve the
+ documentation here at some stage. possibly adding documentation for
+ individual functions - at least the less obvious ones.)
+
=cut
*/
Modified: branches/unshared_buffers/src/pmc/callcontext.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/callcontext.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/callcontext.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -152,6 +152,17 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+/*
+
+=item C<static void ensure_positionals_storage(PARROT_INTERP, PMC *self, INTVAL
+size)>
+
+
+
+=cut
+
+*/
+
static void
ensure_positionals_storage(PARROT_INTERP, ARGIN(PMC *self), INTVAL size)
{
@@ -166,6 +177,17 @@
ensure_positionals_storage_ap(interp, self, size, allocated_positionals);
}
+/*
+
+=item C<static void ensure_positionals_storage_ap(PARROT_INTERP, PMC *self,
+INTVAL size, INTVAL allocated_positionals)>
+
+
+
+=cut
+
+*/
+
static void
ensure_positionals_storage_ap(PARROT_INTERP,
ARGIN(PMC *self), INTVAL size, INTVAL allocated_positionals)
@@ -201,6 +223,16 @@
SETATTR_CallContext_positionals(interp, self, new_array);
}
+/*
+
+=item C<static Pcc_cell* get_cell_at(PARROT_INTERP, PMC *self, INTVAL key)>
+
+
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
static Pcc_cell*
get_cell_at(PARROT_INTERP, ARGIN(PMC *self), INTVAL key)
@@ -212,6 +244,16 @@
return &cells[key];
}
+/*
+
+=item C<static INTVAL autobox_intval(PARROT_INTERP, const Pcc_cell *cell)>
+
+
+
+=cut
+
+*/
+
static INTVAL
autobox_intval(PARROT_INTERP, ARGIN(const Pcc_cell *cell))
{
@@ -235,6 +277,16 @@
return 0;
}
+/*
+
+=item C<static FLOATVAL autobox_floatval(PARROT_INTERP, const Pcc_cell *cell)>
+
+
+
+=cut
+
+*/
+
static FLOATVAL
autobox_floatval(PARROT_INTERP, ARGIN(const Pcc_cell *cell))
{
@@ -258,6 +310,16 @@
return 0.0;
}
+/*
+
+=item C<static STRING * autobox_string(PARROT_INTERP, const Pcc_cell *cell)>
+
+
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
static STRING *
autobox_string(PARROT_INTERP, ARGIN(const Pcc_cell *cell))
@@ -282,6 +344,16 @@
return NULL;
}
+/*
+
+=item C<static PMC * autobox_pmc(PARROT_INTERP, Pcc_cell *cell, INTVAL type)>
+
+
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
static PMC *
autobox_pmc(PARROT_INTERP, ARGIN(Pcc_cell *cell), INTVAL type)
@@ -312,6 +384,16 @@
return result;
}
+/*
+
+=item C<static Hash * get_hash(PARROT_INTERP, PMC *SELF)>
+
+
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
static Hash *
get_hash(PARROT_INTERP, ARGIN(PMC *SELF))
@@ -334,6 +416,16 @@
return hash;
}
+/*
+
+=item C<static void mark_cell(PARROT_INTERP, Pcc_cell *c)>
+
+
+
+=cut
+
+*/
+
static void
mark_cell(PARROT_INTERP, ARGIN(Pcc_cell *c))
{
@@ -355,6 +447,16 @@
}
+/*
+
+=item C<static void mark_positionals(PARROT_INTERP, PMC *self)>
+
+
+
+=cut
+
+*/
+
static void
mark_positionals(PARROT_INTERP, ARGIN(PMC *self))
{
@@ -373,6 +475,16 @@
}
}
+/*
+
+=item C<static void mark_hash(PARROT_INTERP, Hash *h)>
+
+
+
+=cut
+
+*/
+
/* don't look now, but here goes encapsulation.... */
static void
mark_hash(PARROT_INTERP, ARGIN(Hash *h))
@@ -391,6 +503,16 @@
}
}
+/*
+
+=item C<static PMC * get_named_names(PARROT_INTERP, PMC *SELF)>
+
+
+
+=cut
+
+*/
+
PARROT_CAN_RETURN_NULL
static PMC *
get_named_names(PARROT_INTERP, ARGIN(PMC *SELF))
Modified: branches/unshared_buffers/src/pmc/capture.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/capture.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/capture.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2009, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
$Id$
=head1 NAME
@@ -26,6 +26,7 @@
do { \
GETATTR_Capture_array((i), (obj), (arr)); \
if (!(arr)) { \
+ PObj_custom_mark_SET(obj); \
(arr) = Parrot_pmc_new((i), enum_class_ResizablePMCArray); \
SETATTR_Capture_array((i), (obj), (arr)); \
} \
@@ -34,6 +35,7 @@
do { \
GETATTR_Capture_hash((i), (obj), (hsh)); \
if (!(hsh)) { \
+ PObj_custom_mark_SET(obj); \
(hsh) = Parrot_pmc_new((i), enum_class_Hash); \
SETATTR_Capture_hash((i), (obj), (hsh)); \
} \
@@ -45,20 +47,6 @@
/*
-=item C<void init()>
-
-Initializes the Capture instance.
-
-=cut
-
-*/
-
- VTABLE void init() {
- PObj_custom_mark_SET(SELF);
- }
-
-/*
-
=item C<PMC *clone()>
Creates an identical copy of the Capture.
@@ -72,12 +60,16 @@
PMC *dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
GET_ATTR_array(INTERP, SELF, array);
GET_ATTR_hash(INTERP, SELF, hash);
- if (array)
- array = VTABLE_clone(INTERP, array);
- if (hash)
- hash = VTABLE_clone(INTERP, hash);
- SET_ATTR_array(INTERP, dest, array);
- SET_ATTR_hash(INTERP, dest, hash);
+ if (!PMC_IS_NULL(array)) {
+ PObj_custom_mark_SET(dest);
+ array = VTABLE_clone(INTERP, array);
+ SET_ATTR_array(INTERP, dest, array);
+ }
+ if (!PMC_IS_NULL(hash)) {
+ PObj_custom_mark_SET(dest);
+ hash = VTABLE_clone(INTERP, hash);
+ SET_ATTR_hash(INTERP, dest, hash);
+ }
return dest;
}
Modified: branches/unshared_buffers/src/pmc/class.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/class.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/class.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -187,6 +187,16 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+/*
+
+=item C<static int pointer_compare(PARROT_INTERP, const void *a, const void *b)>
+
+
+
+=cut
+
+*/
+
static int
pointer_compare(SHIM_INTERP, ARGIN_NULLOK(const void *a),
ARGIN_NULLOK(const void *b))
@@ -195,6 +205,17 @@
return a != b;
}
+/*
+
+=item C<static size_t key_hash_pointer(PARROT_INTERP, const void *value, size_t
+seed)>
+
+
+
+=cut
+
+*/
+
static size_t
key_hash_pointer(SHIM_INTERP, ARGIN(const void *value), size_t seed)
{
@@ -202,6 +223,17 @@
return ((size_t) value ^ seed);
}
+/*
+
+=item C<static int cache_class_attribs(PARROT_INTERP, PMC *cur_class, PMC
+*attrib_index, PMC *cache, int cur_index)>
+
+
+
+=cut
+
+*/
+
static int
cache_class_attribs(PARROT_INTERP,
ARGIN(PMC *cur_class), ARGIN(PMC *attrib_index),
@@ -241,8 +273,17 @@
return cur_index;
}
-/* This function builds the attribute index (table to map class name and
- * attribute name to an index) for the current class. */
+/*
+
+=item C<static void build_attrib_index(PARROT_INTERP, PMC *self)>
+
+This function builds the attribute index (table to map class name and
+attribute name to an index) for the current class.
+
+=cut
+
+*/
+
static void
build_attrib_index(PARROT_INTERP, ARGIN(PMC *self))
{
@@ -272,7 +313,16 @@
_class->attrib_cache = cache;
}
-/* Takes a hash and initializes the class based on it. */
+/*
+
+=item C<static void init_class_from_hash(PARROT_INTERP, PMC *self, PMC *info)>
+
+Takes a hash and initializes the class based on it.
+
+=cut
+
+*/
+
static void
init_class_from_hash(PARROT_INTERP, ARGMOD(PMC *self), ARGIN_NULLOK(PMC *info))
{
@@ -434,6 +484,17 @@
Parrot_oo_extract_methods_from_namespace(interp, self, _class->_namespace);
}
+/*
+
+=item C<static void initialize_parents(PARROT_INTERP, PMC *object, PMC
+*all_parents)>
+
+
+
+=cut
+
+*/
+
static void
initialize_parents(PARROT_INTERP, ARGIN(PMC *object), ARGIN(PMC *all_parents))
{
@@ -463,6 +524,17 @@
}
}
+/*
+
+=item C<static void initialize_parents_pmc(PARROT_INTERP, PMC *object, PMC
+*all_parents, PMC *init)>
+
+
+
+=cut
+
+*/
+
static void
initialize_parents_pmc(PARROT_INTERP, ARGIN(PMC *object),
ARGIN(PMC *all_parents), ARGIN(PMC *init))
@@ -491,10 +563,19 @@
}
}
-/* This function makes and caches the name of this class, returning the string
- * directly. VTABLE_isa() uses the name without copying it, for efficiency
- * reasons, as it does not modify the STRING. VTABLE_get_string() makes a copy
- * of the STRING, so its callers are free to modify it. */
+/*
+
+=item C<static STRING * make_class_name(PARROT_INTERP, PMC *SELF)>
+
+This function makes and caches the name of this class, returning the string
+directly. C<VTABLE_isa()> uses the name without copying it, for efficiency
+reasons, as it does not modify the STRING. C<VTABLE_get_string()> makes a
+copy of the STRING, so its callers are free to modify it.
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
static STRING *
make_class_name(PARROT_INTERP, ARGIN(PMC *SELF))
@@ -525,11 +606,19 @@
return _class->name;
}
-/* calculates the C3 method resolution order for this class. C3 is the
- * name of an algorithm used to calculate the method resolution order
- * (MRO) to use in a system with multiple inheritance. For more information
- * see the documentation associated with C<Parrot_ComputeMRO_C3>.
- */
+/*
+
+=item C<static void calculate_mro(PARROT_INTERP, PMC *SELF, INTVAL num_parents)>
+
+Calculates the C3 method resolution order for this class. C3 is the name of an
+algorithm used to calculate the method resolution order (MRO) to use in a
+system with multiple inheritance. For more information see the documentation
+associated with C<Parrot_ComputeMRO_C3>.
+
+=cut
+
+*/
+
static void
calculate_mro(PARROT_INTERP, ARGIN(PMC *SELF), INTVAL num_parents)
{
Modified: branches/unshared_buffers/src/pmc/complex.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/complex.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/complex.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -64,7 +64,8 @@
/*
-=item C<static void complex_parse_string(PARROT_INTERP, FLOATVAL *re, FLOATVAL *im, STRING *value)>
+=item C<static void complex_parse_string(PARROT_INTERP, FLOATVAL *re, FLOATVAL
+*im, STRING *value)>
Parses the string in C<value> to produce a complex number, represented
by the real (C<*re>) and imaginary (C<*im>) parts. Raises an exception
@@ -245,8 +246,6 @@
=item C<static void int_check_divide_zero(PARROT_INTERP, INTVAL value)>
-
-
=cut
*/
@@ -265,8 +264,6 @@
=item C<static void float_check_divide_zero(PARROT_INTERP, FLOATVAL value)>
-
-
=cut
*/
@@ -285,8 +282,6 @@
=item C<static void complex_check_divide_zero(PARROT_INTERP, PMC *value)>
-
-
=cut
*/
Modified: branches/unshared_buffers/src/pmc/coroutine.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/coroutine.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/coroutine.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -50,8 +50,6 @@
=item C<static void print_sub_name(PARROT_INTERP, PMC *sub_pmc)>
-
-
=cut
*/
Modified: branches/unshared_buffers/src/pmc/eval.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/eval.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/eval.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -52,6 +52,17 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+/*
+
+=item C<static void clear_fixups(PARROT_INTERP, const Parrot_Sub_attributes
+*sub_data)>
+
+
+
+=cut
+
+*/
+
static void
clear_fixups(PARROT_INTERP, ARGIN(const Parrot_Sub_attributes *sub_data))
{
@@ -80,6 +91,16 @@
}
}
+/*
+
+=item C<static PMC* get_sub(PARROT_INTERP, PMC *self, int idx)>
+
+
+
+=cut
+
+*/
+
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
static PMC*
@@ -116,6 +137,16 @@
return PMCNULL;
}
+/*
+
+=item C<static void mark_subs(PARROT_INTERP, PMC *self)>
+
+
+
+=cut
+
+*/
+
static void
mark_subs(PARROT_INTERP, ARGIN(PMC *self))
{
Modified: branches/unshared_buffers/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/fixedintegerarray.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/fixedintegerarray.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -11,10 +11,6 @@
This class, FixedIntegerArray, implements an array of fixed size which stores
INTVALs. It uses Integer PMCs for all of the conversions.
-=head2 Functions
-
-=over 4
-
=cut
*/
@@ -34,23 +30,6 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
-/*
-
-=item C<static int auxcmpfunc(const INTVAL *i, const INTVAL *j)>
-
-
-
-=cut
-
-*/
-
-PARROT_PURE_FUNCTION
-static int
-auxcmpfunc(ARGIN(const INTVAL *i), ARGIN(const INTVAL *j))
-{
- ASSERT_ARGS(auxcmpfunc)
- return *i - *j;
-}
pmclass FixedIntegerArray auto_attrs provides array {
ATTR INTVAL size; /* number of INTVALs stored in this array */
@@ -58,9 +37,7 @@
/*
-=back
-
-=head2 Methods
+=head2 Vtable functions
=over 4
@@ -521,25 +498,6 @@
SELF.set_pmc_keyed_int(k, value);
}
- METHOD sort(PMC *cmp_func :optional) {
- UINTVAL n;
- INTVAL size;
-
- GET_ATTR_size(INTERP, SELF, size);
- n = (UINTVAL)size;
-
- if (n > 1) {
- INTVAL *int_array;
- GET_ATTR_int_array(INTERP, SELF, int_array);
- if (PMC_IS_NULL(cmp_func))
- qsort(int_array, n, sizeof (INTVAL),
- (int (*)(const void *, const void*))auxcmpfunc);
- else
- Parrot_quicksort(INTERP, (void**)int_array, n, cmp_func);
- }
- RETURN(PMC *SELF);
- }
-
/*
=item C<INTVAL is_equal(PMC *value)>
@@ -643,6 +601,66 @@
int_array[i] = VTABLE_shift_integer(INTERP, info);
}
}
+
+/*
+
+=back
+
+=head2 Methods
+
+=over 4
+
+=item C<PMC *sort()>
+
+Sort the array and return self.
+
+=cut
+
+*/
+
+ METHOD sort(PMC *cmp_func :optional) {
+ UINTVAL n;
+ INTVAL size;
+
+ GET_ATTR_size(INTERP, SELF, size);
+ n = (UINTVAL)size;
+
+ if (n > 1) {
+ INTVAL *int_array;
+ GET_ATTR_int_array(INTERP, SELF, int_array);
+ if (PMC_IS_NULL(cmp_func))
+ qsort(int_array, n, sizeof (INTVAL),
+ (int (*)(const void *, const void*))auxcmpfunc);
+ else
+ Parrot_quicksort(INTERP, (void**)int_array, n, cmp_func);
+ }
+ RETURN(PMC *SELF);
+ }
+
+}
+
+/*
+
+=back
+
+=head2 Auxiliary functions
+
+=over 4
+
+=item C<static int auxcmpfunc(const INTVAL *i, const INTVAL *j)>
+
+INTVAL compare function for qsort usage.
+
+=cut
+
+*/
+
+PARROT_PURE_FUNCTION
+static int
+auxcmpfunc(ARGIN(const INTVAL *i), ARGIN(const INTVAL *j))
+{
+ ASSERT_ARGS(auxcmpfunc)
+ return *i - *j;
}
/*
Modified: branches/unshared_buffers/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/fixedpmcarray.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/fixedpmcarray.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -68,20 +68,6 @@
=over 4
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-
- VTABLE void init() {
- PObj_custom_mark_destroy_SETALL(SELF);
- }
-
-/*
-
=item C<void init_int(INTVAL size)>
Initializes the array.
@@ -96,8 +82,6 @@
_("FixedPMCArray: Cannot set array size to a negative number (%d)"), size);
SELF.set_integer_native(size);
-
- PObj_custom_mark_destroy_SETALL(SELF);
}
/*
@@ -406,6 +390,7 @@
for (i = 0; i < size; ++i)
data[i] = PMCNULL;
+ PObj_custom_mark_destroy_SETALL(SELF);
PMC_array(SELF) = data;
}
Modified: branches/unshared_buffers/src/pmc/fixedstringarray.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/fixedstringarray.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/fixedstringarray.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -35,20 +35,6 @@
=over 4
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-
- VTABLE void init() {
- PObj_custom_mark_destroy_SETALL(SELF);
- }
-
-/*
-
=item C<void init_int(INTVAL size)>
Initializes the array.
@@ -61,9 +47,12 @@
if (size < 0)
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
_("FixedStringArray: Cannot set array size to a negative number (%d)"), size);
- SET_ATTR_size(INTERP, SELF, size);
- SET_ATTR_str_array(INTERP, SELF, mem_gc_allocate_n_zeroed_typed(INTERP, size, STRING *));
- PObj_custom_mark_destroy_SETALL(SELF);
+ if (size) {
+ SET_ATTR_size(INTERP, SELF, size);
+ SET_ATTR_str_array(INTERP,
+ SELF, mem_gc_allocate_n_zeroed_typed(INTERP, size, STRING *));
+ PObj_custom_mark_destroy_SETALL(SELF);
+ }
}
Modified: branches/unshared_buffers/src/pmc/hash.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/hash.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/hash.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -110,7 +110,7 @@
VTABLE void mark() {
Hash * const hash = (Hash *)SELF.get_pointer();
- if (hash != NULL)
+ if (hash && hash->entries)
parrot_mark_hash(INTERP, hash);
}
Modified: branches/unshared_buffers/src/pmc/imageio.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/imageio.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/imageio.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -10,6 +10,10 @@
Freezes and thaws other PMCs.
+=head1 FUNCTIONS
+
+=over 4
+
=cut
*/
@@ -119,6 +123,16 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+/*
+
+=item C<static opcode_t * GET_VISIT_CURSOR(const PMC *pmc)>
+
+
+
+=cut
+
+*/
+
PARROT_INLINE
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
@@ -132,6 +146,16 @@
return (opcode_t *)(buf + pos);
}
+/*
+
+=item C<static void SET_VISIT_CURSOR(PMC *pmc, const char *cursor)>
+
+
+
+=cut
+
+*/
+
PARROT_INLINE
static void
@@ -143,6 +167,16 @@
PARROT_IMAGEIO(pmc)->pos = (cursor - bufstart);
}
+/*
+
+=item C<static void INC_VISIT_CURSOR(PMC *pmc, UINTVAL inc)>
+
+
+
+=cut
+
+*/
+
PARROT_INLINE
static void
@@ -157,6 +191,16 @@
#define BYTECODE_SHIFT_OK(pmc) PARROT_ASSERT( \
PARROT_IMAGEIO(pmc)->pos <= PARROT_IMAGEIO(pmc)->input_length)
+/*
+
+=item C<static void create_buffer(PARROT_INTERP, PMC *pmc, PMC *info)>
+
+
+
+=cut
+
+*/
+
static void
create_buffer(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc), ARGMOD(PMC *info))
{
@@ -185,13 +229,15 @@
(const char *)Buffer_bufstart(PARROT_IMAGEIO(info)->buffer));
}
-
/*
-static void ensure_buffer_size(PARROT_INTERP, PMC *io, size_t len)
-Checks the size of the buffer to see if it can accommodate 'len' more
+=item C<static void ensure_buffer_size(PARROT_INTERP, PMC *io, size_t len)>
+
+Checks the size of the buffer to see if it can accommodate C<len> more
bytes. If not, expands the buffer.
+=cut
+
*/
PARROT_INLINE
@@ -220,6 +266,15 @@
#endif
}
+/*
+
+=item C<static INTVAL INFO_HAS_DATA(const PMC *io)>
+
+
+
+=cut
+
+*/
PARROT_WARN_UNUSED_RESULT
PARROT_INLINE
@@ -231,6 +286,15 @@
return PARROT_IMAGEIO(io)->pos < PARROT_IMAGEIO(io)->input_length;
}
+/*
+
+=item C<static PMC* id_list_get(PARROT_INTERP, const PMC *io, UINTVAL id)>
+
+
+
+=cut
+
+*/
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
@@ -243,6 +307,16 @@
return VTABLE_get_pmc_keyed_int(interp, PARROT_IMAGEIO(io)->todo, id - 1);
}
+/*
+
+=item C<static PMC * visit_todo_list_thaw(PARROT_INTERP, PMC* info)>
+
+
+
+=cut
+
+*/
+
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
@@ -294,6 +368,16 @@
return pmc;
}
+/*
+
+=item C<static void visit_todo_list_freeze(PARROT_INTERP, PMC* pmc, PMC* info)>
+
+
+
+=cut
+
+*/
+
static void
visit_todo_list_freeze(PARROT_INTERP, ARGIN_NULLOK(PMC* pmc), ARGMOD(PMC* info))
@@ -361,6 +445,8 @@
/*
+=back
+
=head1 VTABLES
=over 4
@@ -380,36 +466,12 @@
*/
VTABLE void init() {
PARROT_IMAGEIO(SELF)->seen = PMCNULL;
- PARROT_IMAGEIO(SELF)->pf = PackFile_new(INTERP, 0);
PARROT_IMAGEIO(SELF)->todo =
Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
PObj_flag_CLEAR(private1, SELF);
- PObj_custom_mark_destroy_SETALL(SELF);
- }
-
-
-/*
-
-=item C<void init_pmc(PMC *pmc)>
-
-Initializes the PMC with a pre-existing C<PackFile_ConstTable>.
-
-=cut
-
-*/
- VTABLE void init_pmc(PMC *pmc) {
- PARROT_IMAGEIO(SELF)->seen = PMCNULL;
- PARROT_IMAGEIO(SELF)->pf = PackFile_new(INTERP, 0);
- PARROT_IMAGEIO(SELF)->pf_ct =
- (PackFile_ConstTable *)VTABLE_get_pointer(INTERP, pmc);
- PARROT_IMAGEIO(SELF)->todo =
- Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray);
-
- PObj_flag_SET(private1, SELF);
-
- PObj_custom_mark_destroy_SETALL(SELF);
+ PObj_custom_mark_SET(SELF);
}
@@ -717,16 +779,24 @@
VTABLE void set_pmc(PMC *p)
{
- const UINTVAL header_length =
- GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
-
PARROT_IMAGEIO(SELF)->what = VISIT_FREEZE_NORMAL;
create_buffer(INTERP, p, SELF);
- ensure_buffer_size(INTERP, SELF, header_length);
- mem_sys_memcopy(GET_VISIT_CURSOR(SELF),
- PARROT_IMAGEIO(SELF)->pf->header, PACKFILE_HEADER_BYTES);
- INC_VISIT_CURSOR(SELF, header_length);
+ if (PObj_flag_TEST(private1, SELF)) {
+ PARROT_IMAGEIO(SELF)->pf = PARROT_IMAGEIO(SELF)->pf_ct->base.pf;
+ }
+ else {
+ const UINTVAL header_length =
+ GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
+
+ PARROT_IMAGEIO(SELF)->pf = PackFile_new(INTERP, 0);
+ PObj_custom_destroy_SET(SELF);
+
+ ensure_buffer_size(INTERP, SELF, header_length);
+ mem_sys_memcopy(GET_VISIT_CURSOR(SELF),
+ PARROT_IMAGEIO(SELF)->pf->header, PACKFILE_HEADER_BYTES);
+ INC_VISIT_CURSOR(SELF, header_length);
+ }
PARROT_IMAGEIO(SELF)->seen = Parrot_pmc_new(INTERP, enum_class_Hash);
VTABLE_set_pointer(INTERP, PARROT_IMAGEIO(SELF)->seen,
@@ -738,10 +808,6 @@
VTABLE void set_string_native(STRING *image) {
PMC *unused;
- int unpacked_length;
- const UINTVAL header_length =
- GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
-
PARROT_IMAGEIO(SELF)->what = VISIT_THAW_NORMAL;
PARROT_IMAGEIO(SELF)->buffer = (Buffer *)image;
@@ -749,16 +815,28 @@
(const char *)Buffer_bufstart(PARROT_IMAGEIO(SELF)->buffer));
PARROT_IMAGEIO(SELF)->input_length = image->strlen;
- PARROT_IMAGEIO(SELF)->pf->options |= PFOPT_PMC_FREEZE_ONLY;
- unpacked_length = PackFile_unpack(INTERP, PARROT_IMAGEIO(SELF)->pf,
- GET_VISIT_CURSOR(SELF), PARROT_IMAGEIO(SELF)->input_length);
-
- if (unpacked_length)
- INC_VISIT_CURSOR(SELF, header_length);
- else
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_STRING_REPRESENTATION,
- "PackFile header failed during unpack");
+ if (PObj_flag_TEST(private1, SELF)) {
+ PARROT_IMAGEIO(SELF)->pf = PARROT_IMAGEIO(SELF)->pf_ct->base.pf;
+ }
+ else {
+ const UINTVAL header_length =
+ GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
+ int unpacked_length;
+
+ PARROT_IMAGEIO(SELF)->pf = PackFile_new(INTERP, 0);
+ PObj_custom_destroy_SET(SELF);
+
+ PARROT_IMAGEIO(SELF)->pf->options |= PFOPT_PMC_FREEZE_ONLY;
+ unpacked_length = PackFile_unpack(INTERP, PARROT_IMAGEIO(SELF)->pf,
+ GET_VISIT_CURSOR(SELF), PARROT_IMAGEIO(SELF)->input_length);
+
+ if (unpacked_length)
+ INC_VISIT_CURSOR(SELF, header_length);
+ else
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
+ EXCEPTION_INVALID_STRING_REPRESENTATION,
+ "PackFile header failed during unpack");
+ }
unused = STATICSELF.shift_pmc();
Parrot_visit_loop_visit(INTERP, SELF);
Modified: branches/unshared_buffers/src/pmc/imageiosize.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/imageiosize.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/imageiosize.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -43,8 +43,6 @@
=item C<static void visit_todo_list_freeze(PARROT_INTERP, PMC* pmc, PMC* info)>
-
-
=back
=cut
@@ -305,8 +303,10 @@
VTABLE void set_pmc(PMC *p)
{
- UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
- PARROT_IMAGEIOSIZE(SELF)->size += header_length;
+ if (!PObj_flag_TEST(private1, SELF)) {
+ UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
+ PARROT_IMAGEIOSIZE(SELF)->size += header_length;
+ }
visit_todo_list_freeze(INTERP, p, SELF);
Parrot_visit_loop_visit(INTERP, SELF);
Modified: branches/unshared_buffers/src/pmc/integer.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/integer.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/integer.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -43,6 +43,18 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+/*
+
+=item C<static void maybe_throw_overflow_error(PARROT_INTERP)>
+
+Checks to see if the interpreter is set to throw an exception on overflow.
+
+If so, throw the exception, otherwise ignore.
+
+=cut
+
+*/
+
static void
maybe_throw_overflow_error(PARROT_INTERP)
{
@@ -56,6 +68,16 @@
"Integer overflow");
}
+/*
+
+=item C<static PMC* upgrade_self_to_bignum(PARROT_INTERP, PMC *self)>
+
+Returns a pointer of *self upgraded to a bignum
+
+=cut
+
+*/
+
PARROT_IGNORABLE_RESULT
PARROT_CANNOT_RETURN_NULL
static PMC*
Modified: branches/unshared_buffers/src/pmc/null.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/null.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/null.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -32,6 +32,16 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+/*
+
+=item C<static void null_pmc_access(PARROT_INTERP, int index)>
+
+
+
+=cut
+
+*/
+
PARROT_DOES_NOT_RETURN
static void
null_pmc_access(PARROT_INTERP, int index)
Modified: branches/unshared_buffers/src/pmc/orderedhash.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/orderedhash.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/orderedhash.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -132,8 +132,18 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
-/* Get list_item by index */
-/* XXX Can this actually return NULL or not? */
+/*
+
+=item C<static PMC* get_list_item(PARROT_INTERP, PMC *self, INTVAL idx)>
+
+Get list_item by index
+
+XXX Can this actually return NULL or not?
+
+=cut
+
+*/
+
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
static PMC*
@@ -158,8 +168,19 @@
return list_entry;
}
-/* Find first/last in cloned/thawed OrderedHash */
-/* Parameter C<pmc_hash> is Hash, not OrderedHash */
+/*
+
+=item C<static void find_bounds(PARROT_INTERP, PMC *pmc_hash, PMC **first, PMC
+**last)>
+
+Find first/last in cloned/thawed OrderedHash
+
+Parameter C<pmc_hash> is Hash, not OrderedHash
+
+=cut
+
+*/
+
static void
find_bounds(PARROT_INTERP, ARGIN(PMC *pmc_hash), ARGMOD(PMC **first), ARGMOD(PMC **last))
{
@@ -182,6 +203,17 @@
}
/* Helpers for boxing values */
+
+/*
+
+=item C<static PMC* box_string(PARROT_INTERP, STRING *str)>
+
+Helper function to box STRING
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static PMC*
@@ -195,6 +227,16 @@
return ret;
}
+/*
+
+=item C<static PMC* box_integer(PARROT_INTERP, INTVAL val)>
+
+Helper function to box INTVAL
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static PMC*
@@ -208,6 +250,16 @@
return ret;
}
+/*
+
+=item C<static PMC* box_number(PARROT_INTERP, FLOATVAL val)>
+
+Helper function to box FLOATVAL
+
+=cut
+
+*/
+
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static PMC*
Modified: branches/unshared_buffers/src/pmc/packfile.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/packfile.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/packfile.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -41,8 +41,16 @@
/* HEADERIZER END: static */
/*
+
+=item C<static void copy_packfile_header(PARROT_INTERP, PMC *self, PackFile
+*pf)>
+
Copy attributes from PackFile* to Packfile PMC.
+
+=cut
+
*/
+
static void
copy_packfile_header(PARROT_INTERP, ARGMOD(PMC *self), ARGIN(PackFile *pf))
{
Modified: branches/unshared_buffers/src/pmc/packfiledirectory.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/packfiledirectory.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/packfiledirectory.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2009, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
$Id$
=head1 NAME
@@ -43,7 +43,7 @@
*/
VTABLE void init() {
- Parrot_PackfileDirectory_attributes * attrs =
+ Parrot_PackfileDirectory_attributes * const attrs =
PMC_data_typed(SELF, Parrot_PackfileDirectory_attributes*);
attrs->hash = Parrot_pmc_new(INTERP, enum_class_Hash);
@@ -62,7 +62,7 @@
*/
VTABLE void mark() {
- Parrot_PackfileDirectory_attributes * attrs =
+ Parrot_PackfileDirectory_attributes * const attrs =
PARROT_PACKFILEDIRECTORY(SELF);
Parrot_gc_mark_PMC_alive(INTERP, attrs->hash);
Modified: branches/unshared_buffers/src/pmc/resizablepmcarray.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/resizablepmcarray.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/resizablepmcarray.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -89,20 +89,6 @@
pmclass ResizablePMCArray extends FixedPMCArray auto_attrs provides array {
ATTR INTVAL resize_threshold; /* max size before array needs resizing */
-
-/*
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-
- VTABLE void init() {
- PObj_custom_mark_destroy_SETALL(SELF);
- }
-
/*
=item C<void set_integer_native(INTVAL size)>
Modified: branches/unshared_buffers/src/pmc/sub.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/sub.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/sub.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -37,8 +37,6 @@
=item C<static void print_sub_name(PARROT_INTERP, PMC *sub)>
-
-
=cut
*/
Modified: branches/unshared_buffers/src/pmc/threadinterpreter.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/threadinterpreter.pmc Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc/threadinterpreter.pmc Mon Aug 16 00:44:30 2010 (r48518)
@@ -49,8 +49,6 @@
=item C<static void stop_GC(Interp *parent, Interp *thread)>
-
-
=cut
*/
Modified: branches/unshared_buffers/src/pmc_freeze.c
==============================================================================
--- branches/unshared_buffers/src/pmc_freeze.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/pmc_freeze.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -62,8 +62,8 @@
/*
-=item C<STRING * Parrot_freeze_pbc(PARROT_INTERP, PMC *pmc, const
-PackFile_ConstTable *pf)>
+=item C<opcode_t * Parrot_freeze_pbc(PARROT_INTERP, PMC *pmc, const
+PackFile_ConstTable *pf, opcode_t *cursor)>
Freezes a PMC to a PackFile.
@@ -74,21 +74,24 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
-STRING *
-Parrot_freeze_pbc(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(const PackFile_ConstTable *pf))
+opcode_t *
+Parrot_freeze_pbc(PARROT_INTERP, ARGIN(PMC *pmc), ARGIN(const PackFile_ConstTable *pf),
+ ARGIN(opcode_t *cursor))
{
ASSERT_ARGS(Parrot_freeze_pbc)
- PMC *visitor;
- PMC * const pf_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
+ PMC *visitor;
+ STRING *image;
DECL_CONST_CAST;
- VTABLE_set_pointer(interp, pf_pmc,
+ visitor = Parrot_pmc_new(interp, enum_class_ImageIO);
+ VTABLE_set_pointer(interp, visitor,
PARROT_const_cast(void *, (const void *)pf));
-
- visitor = Parrot_pmc_new_init(interp, enum_class_ImageIO, pf_pmc);
VTABLE_set_pmc(interp, visitor, pmc);
- return VTABLE_get_string(interp, visitor);
+ image = VTABLE_get_string(interp, visitor);
+ cursor = PF_store_buf(cursor, image);
+
+ return cursor;
}
@@ -230,8 +233,8 @@
/*
-=item C<PMC* Parrot_thaw_pbc(PARROT_INTERP, STRING *image, PackFile_ConstTable
-*pf)>
+=item C<PMC* Parrot_thaw_pbc(PARROT_INTERP, PackFile_ConstTable *ct, const
+opcode_t **cursor)>
Thaw a pmc frozen by Parrot_freeze_pbc.
@@ -243,13 +246,13 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CAN_RETURN_NULL
PMC*
-Parrot_thaw_pbc(PARROT_INTERP, ARGIN(STRING *image), ARGIN(PackFile_ConstTable *pf))
+Parrot_thaw_pbc(PARROT_INTERP, ARGIN(PackFile_ConstTable *ct), ARGMOD(const opcode_t **cursor))
{
ASSERT_ARGS(Parrot_thaw_pbc)
- PMC *info = Parrot_pmc_new(interp, enum_class_ImageIO);
-
- VTABLE_set_pointer(interp, info, pf);
-
+ PackFile * const pf = ct->base.pf;
+ STRING *image = PF_fetch_buf(interp, pf, cursor);
+ PMC *info = Parrot_pmc_new(interp, enum_class_ImageIO);
+ VTABLE_set_pointer(interp, info, ct);
VTABLE_set_string_native(interp, info, image);
return VTABLE_get_pmc(interp, info);
}
Modified: branches/unshared_buffers/src/string/api.c
==============================================================================
--- branches/unshared_buffers/src/string/api.c Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/src/string/api.c Mon Aug 16 00:44:30 2010 (r48518)
@@ -2283,22 +2283,20 @@
Parrot_str_to_hashval(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
{
ASSERT_ARGS(Parrot_str_to_hashval)
- String_iter iter;
- UINTVAL offs;
- size_t hashval = interp->hash_seed;
- if (STRING_IS_NULL(s) || !s->strlen)
- return hashval;
+ size_t hashval = interp->hash_seed;
- if (s->encoding->hash)
- hashval = ENCODING_HASH(interp, s, hashval);
- else if (s->charset->compute_hash)
- hashval = CHARSET_COMPUTE_HASH(interp, s, hashval);
- else {
- exit_fatal(1, "String subsystem not properly initialized");
- }
+ if ((!STRING_IS_NULL(s)) && s->strlen) {
+ if (s->encoding->hash)
+ hashval = ENCODING_HASH(interp, s, hashval);
+ else if (s->charset->compute_hash)
+ hashval = CHARSET_COMPUTE_HASH(interp, s, hashval);
+ else {
+ exit_fatal(1, "String subsystem not properly initialized");
+ }
- s->hashval = hashval;
+ s->hashval = hashval;
+ }
return hashval;
}
Modified: branches/unshared_buffers/t/codingstd/pmc_docs.t
==============================================================================
--- branches/unshared_buffers/t/codingstd/pmc_docs.t Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/t/codingstd/pmc_docs.t Mon Aug 16 00:44:30 2010 (r48518)
@@ -122,22 +122,16 @@
__DATA__
src/pmc/bigint.pmc
-src/pmc/bignum.pmc
src/pmc/callcontext.pmc
src/pmc/class.pmc
src/pmc/complex.pmc
src/pmc/coroutine.pmc
src/pmc/eval.pmc
-src/pmc/fixedintegerarray.pmc
src/pmc/imageio.pmc
-src/pmc/imageiosize.pmc
-src/pmc/integer.pmc
src/pmc/namespace.pmc
src/pmc/nci.pmc
src/pmc/null.pmc
src/pmc/object.pmc
-src/pmc/orderedhash.pmc
-src/pmc/packfile.pmc
src/pmc/sub.pmc
src/pmc/threadinterpreter.pmc
src/pmc/unmanagedstruct.pmc
Modified: branches/unshared_buffers/t/compilers/pge/p5regex/p5rx.t
==============================================================================
--- branches/unshared_buffers/t/compilers/pge/p5regex/p5rx.t Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/t/compilers/pge/p5regex/p5rx.t Mon Aug 16 00:44:30 2010 (r48518)
@@ -1,7 +1,6 @@
#!./parrot
# Copyright (C) 2001-2010, Parrot Foundation.
# $Id$
-# vi: ft=pir
=head1 NAME
Modified: branches/unshared_buffers/t/dynoplibs/deprecated.t
==============================================================================
--- branches/unshared_buffers/t/dynoplibs/deprecated.t Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/t/dynoplibs/deprecated.t Mon Aug 16 00:44:30 2010 (r48518)
@@ -16,7 +16,7 @@
=cut
-.const int TESTS = 106
+.const int TESTS = 13
.loadlib 'deprecated_ops'
@@ -38,12 +38,12 @@
$I10 = 10
$I20 = 20
exchange $I10, $I20
- is($I10, 20, 'exchange - first operand ok')
- is($I20, 10, 'exchange - second operand ok')
+ is($I10, 20, 'exchange i - first operand ok')
+ is($I20, 10, 'exchange i - second operand ok')
$I30 = 30
exchange $I30, $I30
- is($I30, 30, 'exchange - reflexive')
+ is($I30, 30, 'exchange i - reflexive')
.end
@@ -83,38 +83,44 @@
cleari
- is($I0, 0, 'cleari - $I0 cleared')
- is($I1, 0, 'cleari - $I1 cleared')
- is($I2, 0, 'cleari - $I2 cleared')
- is($I3, 0, 'cleari - $I3 cleared')
- is($I4, 0, 'cleari - $I4 cleared')
- is($I5, 0, 'cleari - $I5 cleared')
- is($I6, 0, 'cleari - $I6 cleared')
- is($I7, 0, 'cleari - $I7 cleared')
- is($I8, 0, 'cleari - $I8 cleared')
- is($I9, 0, 'cleari - $I9 cleared')
- is($I10, 0, 'cleari - $I10 cleared')
- is($I11, 0, 'cleari - $I11 cleared')
- is($I12, 0, 'cleari - $I12 cleared')
- is($I13, 0, 'cleari - $I13 cleared')
- is($I14, 0, 'cleari - $I14 cleared')
- is($I15, 0, 'cleari - $I15 cleared')
- is($I16, 0, 'cleari - $I16 cleared')
- is($I17, 0, 'cleari - $I17 cleared')
- is($I18, 0, 'cleari - $I18 cleared')
- is($I19, 0, 'cleari - $I19 cleared')
- is($I20, 0, 'cleari - $I20 cleared')
- is($I21, 0, 'cleari - $I21 cleared')
- is($I22, 0, 'cleari - $I22 cleared')
- is($I23, 0, 'cleari - $I23 cleared')
- is($I24, 0, 'cleari - $I24 cleared')
- is($I25, 0, 'cleari - $I25 cleared')
- is($I26, 0, 'cleari - $I26 cleared')
- is($I27, 0, 'cleari - $I27 cleared')
- is($I28, 0, 'cleari - $I28 cleared')
- is($I29, 0, 'cleari - $I29 cleared')
- is($I30, 0, 'cleari - $I30 cleared')
- is($I31, 0, 'cleari - $I31 cleared')
+ $S0 = 'NO'
+
+ ne $I0, 0, result
+ ne $I1, 0, result
+ ne $I2, 0, result
+ ne $I3, 0, result
+ ne $I4, 0, result
+ ne $I5, 0, result
+ ne $I6, 0, result
+ ne $I7, 0, result
+ ne $I8, 0, result
+ ne $I9, 0, result
+ ne $I10, 0, result
+ ne $I11, 0, result
+ ne $I12, 0, result
+ ne $I13, 0, result
+ ne $I14, 0, result
+ ne $I15, 0, result
+ ne $I16, 0, result
+ ne $I17, 0, result
+ ne $I18, 0, result
+ ne $I19, 0, result
+ ne $I20, 0, result
+ ne $I21, 0, result
+ ne $I22, 0, result
+ ne $I23, 0, result
+ ne $I24, 0, result
+ ne $I25, 0, result
+ ne $I26, 0, result
+ ne $I27, 0, result
+ ne $I28, 0, result
+ ne $I29, 0, result
+ ne $I30, 0, result
+ ne $I31, 0, result
+
+ $S0 = 'YES'
+ result:
+ is($S0, 'YES', 'cleari')
.end
.sub test_clearn
@@ -151,49 +157,56 @@
set $N30, 547972.0
set $N31, 547972.0
clearn
- is( $N0, "0", 'clearn' )
- is( $N1, "0", 'clearn' )
- is( $N2, "0", 'clearn' )
- is( $N3, "0", 'clearn' )
- is( $N4, "0", 'clearn' )
- is( $N5, "0", 'clearn' )
- is( $N6, "0", 'clearn' )
- is( $N7, "0", 'clearn' )
- is( $N8, "0", 'clearn' )
- is( $N9, "0", 'clearn' )
- is( $N10, "0", 'clearn' )
- is( $N11, "0", 'clearn' )
- is( $N12, "0", 'clearn' )
- is( $N13, "0", 'clearn' )
- is( $N14, "0", 'clearn' )
- is( $N15, "0", 'clearn' )
- is( $N16, "0", 'clearn' )
- is( $N17, "0", 'clearn' )
- is( $N18, "0", 'clearn' )
- is( $N19, "0", 'clearn' )
- is( $N20, "0", 'clearn' )
- is( $N21, "0", 'clearn' )
- is( $N22, "0", 'clearn' )
- is( $N23, "0", 'clearn' )
- is( $N24, "0", 'clearn' )
- is( $N25, "0", 'clearn' )
- is( $N26, "0", 'clearn' )
- is( $N27, "0", 'clearn' )
- is( $N28, "0", 'clearn' )
- is( $N29, "0", 'clearn' )
- is( $N30, "0", 'clearn' )
- is( $N31, "0", 'clearn' )
+
+ $I0 = 0
+
+ ne $N0, 0.0, result
+ ne $N1, 0.0, result
+ ne $N2, 0.0, result
+ ne $N3, 0.0, result
+ ne $N4, 0.0, result
+ ne $N5, 0.0, result
+ ne $N6, 0.0, result
+ ne $N7, 0.0, result
+ ne $N8, 0.0, result
+ ne $N9, 0.0, result
+ ne $N10, 0.0, result
+ ne $N11, 0.0, result
+ ne $N12, 0.0, result
+ ne $N13, 0.0, result
+ ne $N14, 0.0, result
+ ne $N15, 0.0, result
+ ne $N16, 0.0, result
+ ne $N17, 0.0, result
+ ne $N18, 0.0, result
+ ne $N19, 0.0, result
+ ne $N20, 0.0, result
+ ne $N21, 0.0, result
+ ne $N22, 0.0, result
+ ne $N23, 0.0, result
+ ne $N24, 0.0, result
+ ne $N25, 0.0, result
+ ne $N26, 0.0, result
+ ne $N27, 0.0, result
+ ne $N28, 0.0, result
+ ne $N29, 0.0, result
+ ne $N30, 0.0, result
+ ne $N31, 0.0, result
+
+ $I0 = 1
+ result:
+ is($I0, 1, 'clearn')
.end
.sub test_exchange_n
set $N1, 1.234560
set $N2, 9.876540
exchange $N1, $N2
- is( $N1, "9.87654", 'exchange' )
- is( $N2, "1.23456", 'exchange' )
+ is( $N1, "9.87654", 'exchange n' )
+ is( $N2, "1.23456", 'exchange n' )
set $N3, -100.200300
exchange $N3, $N3
- is( $N3, "-100.2003", 'exchange' )
+ is( $N3, "-100.2003", 'exchange n' )
.end
.sub test_clears
@@ -230,50 +243,57 @@
set $S30, "BOO 30"
set $S31, "BOO 31"
clears
- is( $S0, "", '' )
- is( $S1, "", '' )
- is( $S2, "", '' )
- is( $S3, "", '' )
- is( $S4, "", '' )
- is( $S5, "", '' )
- is( $S6, "", '' )
- is( $S7, "", '' )
- is( $S8, "", '' )
- is( $S9, "", '' )
- is( $S10, "", '' )
- is( $S11, "", '' )
- is( $S12, "", '' )
- is( $S13, "", '' )
- is( $S14, "", '' )
- is( $S15, "", '' )
- is( $S16, "", '' )
- is( $S17, "", '' )
- is( $S18, "", '' )
- is( $S19, "", '' )
- is( $S20, "", '' )
- is( $S21, "", '' )
- is( $S22, "", '' )
- is( $S23, "", '' )
- is( $S24, "", '' )
- is( $S25, "", '' )
- is( $S26, "", '' )
- is( $S27, "", '' )
- is( $S28, "", '' )
- is( $S29, "", '' )
- is( $S30, "", '' )
- is( $S31, "", '' )
+
+ $I0 = 0
+
+ unless_null $S0, result
+ unless_null $S1, result
+ unless_null $S2, result
+ unless_null $S3, result
+ unless_null $S4, result
+ unless_null $S5, result
+ unless_null $S6, result
+ unless_null $S7, result
+ unless_null $S8, result
+ unless_null $S9, result
+ unless_null $S10, result
+ unless_null $S11, result
+ unless_null $S12, result
+ unless_null $S13, result
+ unless_null $S14, result
+ unless_null $S15, result
+ unless_null $S16, result
+ unless_null $S17, result
+ unless_null $S18, result
+ unless_null $S19, result
+ unless_null $S20, result
+ unless_null $S21, result
+ unless_null $S22, result
+ unless_null $S23, result
+ unless_null $S24, result
+ unless_null $S25, result
+ unless_null $S26, result
+ unless_null $S27, result
+ unless_null $S28, result
+ unless_null $S29, result
+ unless_null $S30, result
+ unless_null $S31, result
+
+ $I0 = 1
+ result:
+ is($I0, 1, 'clears')
.end
.sub test_exchange_s
set $S0, "String #0"
set $S1, "String #1"
exchange $S0, $S1
- is( $S0, "String #1", 'exchange' )
- is( $S1, "String #0", 'exchange' )
+ is( $S0, "String #1", 'exchange s' )
+ is( $S1, "String #0", 'exchange s' )
set $S2, "String #2"
exchange $S2, $S2
- is( $S2, "String #2", 'exchange' )
+ is( $S2, "String #2", 'exchange s' )
.end
.sub test_clearp
Modified: branches/unshared_buffers/t/native_pbc/annotations.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/unshared_buffers/t/native_pbc/integer.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/unshared_buffers/t/native_pbc/integer_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/unshared_buffers/t/native_pbc/number.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/unshared_buffers/t/native_pbc/number_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/unshared_buffers/t/native_pbc/string.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/unshared_buffers/t/native_pbc/string_1.pbc
==============================================================================
Binary file (source and/or target). No diff available.
Modified: branches/unshared_buffers/t/op/calling.t
==============================================================================
--- branches/unshared_buffers/t/op/calling.t Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/t/op/calling.t Mon Aug 16 00:44:30 2010 (r48518)
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 98;
+use Parrot::Test tests => 99;
=head1 NAME
@@ -2554,6 +2554,48 @@
done
OUTPUT
+pir_output_is( <<'CODE', <<'OUTPUT', "handling of slurpy after optional, TT #1733" );
+
+# Lua calling convention scheme
+
+# f() has 2 known parameters
+.sub 'f'
+ .param pmc p1 :optional
+ .param int has_p1 :opt_flag
+ .param pmc p2 :optional
+ .param int has_p2 :opt_flag
+ .param pmc extra :slurpy
+ unless has_p1 goto L1
+ say p1
+ unless has_p2 goto L1
+ say p2
+ $P0 = iter extra
+ L2:
+ unless $P0 goto L1
+ $P1 = shift $P0
+ say $P1
+ goto L2
+ L1:
+.end
+
+.sub 'main' :main
+ $P1 = box "p1"
+ $P2 = box "p2"
+ $P3 = box "p3"
+ f($P1, $P2, $P3)
+ f($P1, $P2)
+ f($P1)
+.end
+
+CODE
+p1
+p2
+p3
+p1
+p2
+p1
+OUTPUT
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: branches/unshared_buffers/t/op/cmp-nonbranch.t
==============================================================================
--- branches/unshared_buffers/t/op/cmp-nonbranch.t Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/t/op/cmp-nonbranch.t Mon Aug 16 00:44:30 2010 (r48518)
@@ -17,7 +17,7 @@
=cut
-.const int TESTS = 93
+.const int TESTS = 96
.macro EXP()
exp_nok:
@@ -66,6 +66,7 @@
'iseq'()
'isne'()
'cmp'()
+ 'cmp_string_null'()
'trac#11'()
.end
@@ -1214,6 +1215,24 @@
.end
+.sub 'cmp_string_null'
+ .local string s1, s2
+ .local int r
+ null s1
+ s2 = 'hello'
+
+ r = cmp s1, s2
+ is(r, -1, 'cmp snull, snotnull')
+
+ r = cmp s2, s1
+ is(r, 1, 'cmp snotnull, snull')
+
+ null s2
+ r = cmp s2, s1
+ is(r, 0, 'cmp snull, snull')
+.end
+
+
.sub 'trac#11'
$P0 = new 'String'
assign $P0, 'foo'
Modified: branches/unshared_buffers/t/op/string.t
==============================================================================
--- branches/unshared_buffers/t/op/string.t Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/t/op/string.t Mon Aug 16 00:44:30 2010 (r48518)
@@ -121,6 +121,7 @@
test_find_encoding()
test_assign()
assign_and_globber()
+ split_on_null_string()
split_on_empty_string()
split_on_non_empty_string()
test_join()
@@ -1388,6 +1389,28 @@
is( $S5, "JAPH", 'assign & globber' )
.end
+.sub split_on_null_string
+ .local string s, delim
+ .local pmc p
+ .local int i
+ null s
+ null delim
+ split p, s, delim
+ i = isnull p
+ is(i, 1, 'split on null string and delim')
+
+ s = 'foo'
+ split p, s, delim
+ i = isnull p
+ is(i, 1, 'split on null delim')
+
+ null s
+ delim = 'bar'
+ split p, s, delim
+ i = isnull p
+ is(i, 1, 'split on null string')
+.end
+
.sub split_on_empty_string
split $P1, "", ""
set $I1, $P1
Modified: branches/unshared_buffers/t/perl/Parrot_Test.t
==============================================================================
--- branches/unshared_buffers/t/perl/Parrot_Test.t Sun Aug 15 13:06:43 2010 (r48517)
+++ branches/unshared_buffers/t/perl/Parrot_Test.t Mon Aug 16 00:44:30 2010 (r48518)
@@ -285,6 +285,10 @@
OUTPUT
test_test($desc);
+#
+# incorporate changes in Test::Builder after Version 0.94
+#
+if ($Test::Builder::VERSION <= eval '0.94') {
$desc = 'pir_error_output_like: todo';
$line = line_num(+22);
my $location;
@@ -321,6 +325,34 @@
else {
test_test($desc);
}
+} #end of test for Test::Builder 0.94 or before
+#
+# Test for TEST::Builder after Version 0.94
+#
+else {
+$line = line_num(+14);
+my $location = "at $0 line $line";
+$desc = 'pir_output_like: todo';
+test_out("not ok 1 - $desc # TODO foo");
+$err = <<"EOUT";
+# Failed (TODO) test '$desc'
+# $location.
+# 'foo
+# '
+# doesn't match '/bar/
+# '
+EOUT
+chomp $err;
+test_out($err);
+pir_output_like( <<'CODE', <<"OUTPUT", $desc, todo => 'foo' );
+.sub 'test' :main
+ print "foo\n"
+.end
+CODE
+/bar/
+OUTPUT
+ test_test($desc);
+}
##### PIR-to-PASM output test functions #####
More information about the parrot-commits
mailing list