[svn:parrot] r40830 - in branches/pluggable_runcore: . compilers/imcc compilers/pct/src/PAST compilers/pge/PGE compilers/pirc/src config/auto/sizes config/gen/makefiles config/init/hints docs docs/book/draft docs/book/pct docs/book/pir docs/dev docs/pdds editor examples/benchmarks examples/embed examples/languages/abc examples/languages/squaak examples/pge include/parrot lib/Parrot/Pmc2c ports/cpan ports/cygwin ports/debian ports/fedora ports/mandriva ports/suse runtime/parrot/languages runtime/parrot/library/Math src src/call src/dynpmc src/gc src/interp src/jit/i386 src/ops src/pmc src/runcore src/string src/string/charset src/string/encoding t/compilers/tge t/library t/oo t/op t/pmc t/src t/tools tools/build tools/dev tools/util
cotto at svn.parrot.org
cotto at svn.parrot.org
Thu Aug 27 18:39:05 UTC 2009
Author: cotto
Date: Thu Aug 27 18:38:59 2009
New Revision: 40830
URL: https://trac.parrot.org/parrot/changeset/40830
Log:
bring profiling_runcore up-to-date with trunk
Added:
branches/pluggable_runcore/t/op/inf_nan.t
- copied unchanged from r40829, trunk/t/op/inf_nan.t
Modified:
branches/pluggable_runcore/ (props changed)
branches/pluggable_runcore/MANIFEST
branches/pluggable_runcore/README
branches/pluggable_runcore/compilers/imcc/imcparser.c
branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir
branches/pluggable_runcore/compilers/pge/PGE/Match.pir
branches/pluggable_runcore/compilers/pirc/src/bcgen.c
branches/pluggable_runcore/config/auto/sizes/intval_maxmin_c.in (props changed)
branches/pluggable_runcore/config/gen/makefiles/root.in
branches/pluggable_runcore/config/init/hints/dec_osf.pm
branches/pluggable_runcore/config/init/hints/dragonfly.pm
branches/pluggable_runcore/config/init/hints/hpux.pm
branches/pluggable_runcore/config/init/hints/irix.pm
branches/pluggable_runcore/config/init/hints/netbsd.pm
branches/pluggable_runcore/config/init/hints/openbsd.pm
branches/pluggable_runcore/config/init/hints/solaris.pm
branches/pluggable_runcore/docs/book/draft/README (props changed)
branches/pluggable_runcore/docs/book/draft/appa_glossary.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appb_patch_submission.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appc_command_line_options.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appd_build_options.pod (props changed)
branches/pluggable_runcore/docs/book/draft/appe_source_code.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch01_introduction.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch02_getting_started.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch07_dynpmcs.pod (contents, props changed)
branches/pluggable_runcore/docs/book/draft/ch08_dynops.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch10_opcode_reference.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch11_directive_reference.pod (props changed)
branches/pluggable_runcore/docs/book/draft/ch12_operator_reference.pod (props changed)
branches/pluggable_runcore/docs/book/draft/chXX_hlls.pod (props changed)
branches/pluggable_runcore/docs/book/draft/chXX_library.pod (props changed)
branches/pluggable_runcore/docs/book/draft/chXX_testing_and_debugging.pod (props changed)
branches/pluggable_runcore/docs/book/pct/ch01_introduction.pod (props changed)
branches/pluggable_runcore/docs/book/pct/ch02_getting_started.pod (props changed)
branches/pluggable_runcore/docs/book/pct/ch03_compiler_tools.pod (props changed)
branches/pluggable_runcore/docs/book/pct/ch04_pge.pod (props changed)
branches/pluggable_runcore/docs/book/pct/ch05_nqp.pod (props changed)
branches/pluggable_runcore/docs/book/pir/ch04_variables.pod
branches/pluggable_runcore/docs/dev/c_functions.pod (props changed)
branches/pluggable_runcore/docs/pdds/pdd09_gc.pod
branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod
branches/pluggable_runcore/docs/pdds/pdd30_install.pod (props changed)
branches/pluggable_runcore/docs/pmc.pod
branches/pluggable_runcore/docs/pmc2c.pod
branches/pluggable_runcore/editor/README.pod
branches/pluggable_runcore/examples/benchmarks/primes.pasm
branches/pluggable_runcore/examples/embed/cotorra.c (props changed)
branches/pluggable_runcore/examples/languages/abc/ (props changed)
branches/pluggable_runcore/examples/languages/squaak/ (props changed)
branches/pluggable_runcore/examples/pge/demo.pir (props changed)
branches/pluggable_runcore/include/parrot/call.h (contents, props changed)
branches/pluggable_runcore/include/parrot/gc_api.h (contents, props changed)
branches/pluggable_runcore/include/parrot/hash.h
branches/pluggable_runcore/include/parrot/list.h
branches/pluggable_runcore/include/parrot/pmc.h
branches/pluggable_runcore/include/parrot/pobj.h
branches/pluggable_runcore/include/parrot/runcore_api.h (props changed)
branches/pluggable_runcore/include/parrot/runcore_trace.h (props changed)
branches/pluggable_runcore/include/parrot/sub.h
branches/pluggable_runcore/include/parrot/vtables.h
branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm
branches/pluggable_runcore/ports/cpan/pause_guide.pod (props changed)
branches/pluggable_runcore/ports/cygwin/parrot-1.0.0-1.cygport (props changed)
branches/pluggable_runcore/ports/debian/libparrot-dev.install.in (props changed)
branches/pluggable_runcore/ports/debian/libparrot.install.in (props changed)
branches/pluggable_runcore/ports/debian/parrot-doc.install.in (props changed)
branches/pluggable_runcore/ports/debian/parrot.install.in (props changed)
branches/pluggable_runcore/ports/fedora/parrot.spec.fedora (props changed)
branches/pluggable_runcore/ports/mandriva/parrot.spec.mandriva (props changed)
branches/pluggable_runcore/ports/suse/parrot.spec.suse (props changed)
branches/pluggable_runcore/runtime/parrot/languages/ (props changed)
branches/pluggable_runcore/runtime/parrot/library/Math/Rand.pir (props changed)
branches/pluggable_runcore/src/call/ops.c (props changed)
branches/pluggable_runcore/src/call/pcc.c (contents, props changed)
branches/pluggable_runcore/src/debug.c
branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc
branches/pluggable_runcore/src/dynpmc/subproxy.pmc
branches/pluggable_runcore/src/gc/alloc_memory.c (props changed)
branches/pluggable_runcore/src/gc/alloc_register.c (props changed)
branches/pluggable_runcore/src/gc/alloc_resources.c (contents, props changed)
branches/pluggable_runcore/src/gc/api.c (contents, props changed)
branches/pluggable_runcore/src/gc/gc_inf.c
branches/pluggable_runcore/src/gc/gc_ms.c
branches/pluggable_runcore/src/gc/gc_private.h
branches/pluggable_runcore/src/gc/generational_ms.c (contents, props changed)
branches/pluggable_runcore/src/gc/incremental_ms.c (contents, props changed)
branches/pluggable_runcore/src/gc/malloc.c (props changed)
branches/pluggable_runcore/src/gc/malloc_trace.c (props changed)
branches/pluggable_runcore/src/gc/mark_sweep.c (contents, props changed)
branches/pluggable_runcore/src/gc/system.c (props changed)
branches/pluggable_runcore/src/global_setup.c
branches/pluggable_runcore/src/interp/inter_cb.c (props changed)
branches/pluggable_runcore/src/interp/inter_create.c (contents, props changed)
branches/pluggable_runcore/src/interp/inter_misc.c (contents, props changed)
branches/pluggable_runcore/src/jit/i386/jit_defs.c
branches/pluggable_runcore/src/jit/i386/jit_emit.h
branches/pluggable_runcore/src/jit_debug.c
branches/pluggable_runcore/src/jit_debug_xcoff.c
branches/pluggable_runcore/src/key.c
branches/pluggable_runcore/src/list.c
branches/pluggable_runcore/src/oo.c
branches/pluggable_runcore/src/ops/set.ops
branches/pluggable_runcore/src/ops/string.ops
branches/pluggable_runcore/src/packdump.c
branches/pluggable_runcore/src/pmc.c
branches/pluggable_runcore/src/pmc/addrregistry.pmc
branches/pluggable_runcore/src/pmc/array.pmc
branches/pluggable_runcore/src/pmc/callsignature.pmc
branches/pluggable_runcore/src/pmc/capture.pmc
branches/pluggable_runcore/src/pmc/class.pmc
branches/pluggable_runcore/src/pmc/complex.pmc
branches/pluggable_runcore/src/pmc/continuation.pmc
branches/pluggable_runcore/src/pmc/coroutine.pmc
branches/pluggable_runcore/src/pmc/cpointer.pmc
branches/pluggable_runcore/src/pmc/default.pmc
branches/pluggable_runcore/src/pmc/eval.pmc
branches/pluggable_runcore/src/pmc/eventhandler.pmc
branches/pluggable_runcore/src/pmc/exception.pmc
branches/pluggable_runcore/src/pmc/exceptionhandler.pmc
branches/pluggable_runcore/src/pmc/exporter.pmc
branches/pluggable_runcore/src/pmc/filehandle.pmc
branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc
branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc
branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc
branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc
branches/pluggable_runcore/src/pmc/fixedstringarray.pmc
branches/pluggable_runcore/src/pmc/hash.pmc
branches/pluggable_runcore/src/pmc/hashiterator.pmc
branches/pluggable_runcore/src/pmc/integer.pmc
branches/pluggable_runcore/src/pmc/key.pmc
branches/pluggable_runcore/src/pmc/lexinfo.pmc
branches/pluggable_runcore/src/pmc/managedstruct.pmc
branches/pluggable_runcore/src/pmc/multisub.pmc
branches/pluggable_runcore/src/pmc/namespace.pmc
branches/pluggable_runcore/src/pmc/nci.pmc
branches/pluggable_runcore/src/pmc/object.pmc
branches/pluggable_runcore/src/pmc/orderedhash.pmc
branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc
branches/pluggable_runcore/src/pmc/parrotlibrary.pmc
branches/pluggable_runcore/src/pmc/parrotthread.pmc
branches/pluggable_runcore/src/pmc/pccmethod_test.pmc
branches/pluggable_runcore/src/pmc/pmcproxy.pmc
branches/pluggable_runcore/src/pmc/pointer.pmc
branches/pluggable_runcore/src/pmc/resizablebooleanarray.pmc
branches/pluggable_runcore/src/pmc/resizablefloatarray.pmc
branches/pluggable_runcore/src/pmc/resizableintegerarray.pmc
branches/pluggable_runcore/src/pmc/resizablepmcarray.pmc
branches/pluggable_runcore/src/pmc/resizablestringarray.pmc
branches/pluggable_runcore/src/pmc/retcontinuation.pmc
branches/pluggable_runcore/src/pmc/role.pmc
branches/pluggable_runcore/src/pmc/scalar.pmc
branches/pluggable_runcore/src/pmc/scheduler.pmc
branches/pluggable_runcore/src/pmc/schedulermessage.pmc
branches/pluggable_runcore/src/pmc/sockaddr.pmc
branches/pluggable_runcore/src/pmc/stringhandle.pmc
branches/pluggable_runcore/src/pmc/sub.pmc
branches/pluggable_runcore/src/pmc/task.pmc
branches/pluggable_runcore/src/pmc/timer.pmc
branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc
branches/pluggable_runcore/src/pmc_freeze.c
branches/pluggable_runcore/src/runcore/cores.c (props changed)
branches/pluggable_runcore/src/runcore/main.c (props changed)
branches/pluggable_runcore/src/runcore/trace.c (props changed)
branches/pluggable_runcore/src/string/api.c
branches/pluggable_runcore/src/string/charset/iso-8859-1.c
branches/pluggable_runcore/src/string/charset/unicode.c
branches/pluggable_runcore/src/string/encoding/fixed_8.c
branches/pluggable_runcore/src/string/encoding/utf8.c
branches/pluggable_runcore/src/vtables.c
branches/pluggable_runcore/t/compilers/tge/NoneGrammar.tg (props changed)
branches/pluggable_runcore/t/library/rand.t
branches/pluggable_runcore/t/oo/root_new.t (props changed)
branches/pluggable_runcore/t/op/arithmetics.t
branches/pluggable_runcore/t/op/gc.t
branches/pluggable_runcore/t/pmc/default.t
branches/pluggable_runcore/t/pmc/parrotinterpreter.t
branches/pluggable_runcore/t/pmc/pmc.t
branches/pluggable_runcore/t/pmc/threads.t
branches/pluggable_runcore/t/pmc/undef.t
branches/pluggable_runcore/t/src/embed.t (props changed)
branches/pluggable_runcore/t/tools/pmc2c.t
branches/pluggable_runcore/tools/build/nativecall.pl
branches/pluggable_runcore/tools/dev/fetch_languages.pl (props changed)
branches/pluggable_runcore/tools/dev/mk_gitignore.pl (props changed)
branches/pluggable_runcore/tools/dev/mk_language_shell.pl
branches/pluggable_runcore/tools/util/perlcritic-cage.conf (props changed)
Modified: branches/pluggable_runcore/MANIFEST
==============================================================================
--- branches/pluggable_runcore/MANIFEST Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/MANIFEST Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Aug 27 01:08:17 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Mon Aug 24 09:19:26 2009 UT
#
# See below for documentation on the format of this file.
#
@@ -341,7 +341,6 @@
config/gen/platform/generic/dl.h []
config/gen/platform/generic/env.c []
config/gen/platform/generic/exec.c []
-config/gen/platform/generic/hires_timer.c []
config/gen/platform/generic/io.h []
config/gen/platform/generic/itimer.c []
config/gen/platform/generic/math.c []
@@ -369,7 +368,6 @@
config/gen/platform/win32/dl.c []
config/gen/platform/win32/env.c []
config/gen/platform/win32/exec.c []
-config/gen/platform/win32/hires_timer.c []
config/gen/platform/win32/io.h []
config/gen/platform/win32/misc.c []
config/gen/platform/win32/misc.h []
@@ -1798,6 +1796,7 @@
t/op/globals.t [test]
t/op/hacks.t [test]
t/op/ifunless.t [test]
+t/op/inf_nan.t [test]
t/op/integer.t [test]
t/op/interp.t [test]
t/op/io.t [test]
@@ -2155,7 +2154,6 @@
tools/dev/pbc_to_exe.pir [devel]
tools/dev/pmcrenumber.pl []
tools/dev/pmctree.pl []
-tools/dev/pprof2cg.pl []
tools/dev/reconfigure.pl [devel]
tools/dev/search-ops.pl []
tools/dev/svnclobber.pl []
Modified: branches/pluggable_runcore/README
==============================================================================
--- branches/pluggable_runcore/README Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/README Thu Aug 27 18:38:59 2009 (r40830)
@@ -85,6 +85,13 @@
But please note that dynamic libs will not be found for non-standard
locations unless you set LD_LIBRARY_PATH or similar.
+If you want to build high level languages on top of Parrot, you should
+also run
+
+ make install-dev
+
+to install development files which compilers need in their build process.
+
Look at docs/parrot.pod and docs/intro.pod for where to go from here. If you
have any problems, see the section "How To Submit A Bug Report" in
docs/submissions.pod. These documents are in POD format. You can view these
Modified: branches/pluggable_runcore/compilers/imcc/imcparser.c
==============================================================================
--- branches/pluggable_runcore/compilers/imcc/imcparser.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/compilers/imcc/imcparser.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -3221,17 +3221,17 @@
{
case 2:
#line 1144 "compilers/imcc/imcc.y"
- { if (yynerrs) YYABORT; (yyval.i) = 0; ;}
+ { if (yynerrs) YYABORT; (yyval.i) = 0; }
break;
case 5:
#line 1153 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+ { (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 6:
#line 1154 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+ { (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 7:
@@ -3240,7 +3240,7 @@
(yyval.i) = (yyvsp[(1) - (1)].i);
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
IMCC_INFO(interp)->cur_unit = 0;
- ;}
+ }
break;
case 8:
@@ -3249,32 +3249,32 @@
(yyval.i) = (yyvsp[(1) - (1)].i);
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
IMCC_INFO(interp)->cur_unit = 0;
- ;}
+ }
break;
case 9:
#line 1167 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 10:
#line 1168 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 11:
#line 1169 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 12:
#line 1170 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 13:
#line 1174 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 14:
@@ -3283,7 +3283,7 @@
(yyval.i) = 0;
do_loadlib(interp, (yyvsp[(2) - (3)].s));
mem_sys_free((yyvsp[(2) - (3)].s));
- ;}
+ }
break;
case 15:
@@ -3292,7 +3292,7 @@
IMCC_INFO(interp)->line = atoi((yyvsp[(2) - (5)].s));
/* set_filename() frees the STRINGC */
set_filename(interp, (yyvsp[(4) - (5)].s));
- ;}
+ }
break;
case 16:
@@ -3300,7 +3300,7 @@
{
/* set_filename() frees the STRINGC */
set_filename(interp, (yyvsp[(2) - (3)].s));
- ;}
+ }
break;
case 17:
@@ -3311,7 +3311,7 @@
SymReg * const key = mk_const(interp, (yyvsp[(2) - (4)].s), 'S');
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, ".annotate", 2, key, (yyvsp[(4) - (4)].sr));
mem_sys_free((yyvsp[(2) - (4)].s));
- ;}
+ }
break;
case 18:
@@ -3324,12 +3324,12 @@
IMCC_INFO(interp)->cur_namespace = NULL;
mem_sys_free((yyvsp[(2) - (2)].s));
(yyval.t) = 0;
- ;}
+ }
break;
case 19:
#line 1223 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 20:
@@ -3338,12 +3338,12 @@
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
mem_sys_free((yyvsp[(4) - (6)].s));
IMCC_INFO(interp)->is_def = 0;
- ;}
+ }
break;
case 21:
#line 1232 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 22:
@@ -3352,12 +3352,12 @@
(yyval.i) = mk_pmc_const(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (6)].s), (yyvsp[(4) - (6)].sr), (yyvsp[(6) - (6)].s));
mem_sys_free((yyvsp[(6) - (6)].s));
IMCC_INFO(interp)->is_def = 0;
- ;}
+ }
break;
case 23:
#line 1239 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 24:
@@ -3367,37 +3367,37 @@
mem_sys_free((yyvsp[(3) - (6)].s));
mem_sys_free((yyvsp[(6) - (6)].s));
IMCC_INFO(interp)->is_def = 0;
- ;}
+ }
break;
case 29:
#line 1258 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 30:
#line 1259 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 31:
#line 1260 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 32:
#line 1261 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 33:
#line 1262 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+ { (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 36:
#line 1267 "compilers/imcc/imcc.y"
- { clear_state(interp); ;}
+ { clear_state(interp); }
break;
case 37:
@@ -3407,7 +3407,7 @@
(yyvsp[(2) - (3)].s), 0, IMCC_INFO(interp)->regs,
IMCC_INFO(interp)->nargs, IMCC_INFO(interp) -> keyvec, 1);
mem_sys_free((yyvsp[(2) - (3)].s));
- ;}
+ }
break;
case 38:
@@ -3415,7 +3415,7 @@
{
imc_close_unit(interp, IMCC_INFO(interp)->cur_unit);
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM);
- ;}
+ }
break;
case 39:
@@ -3426,14 +3426,14 @@
mk_sub_label(interp, (yyvsp[(4) - (4)].s)));
IMCC_INFO(interp)->cur_call->pcc_sub->pragma = (yyvsp[(3) - (4)].t);
mem_sys_free((yyvsp[(4) - (4)].s));
- ;}
+ }
break;
case 40:
#line 1289 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr));
- ;}
+ }
break;
case 41:
@@ -3449,17 +3449,17 @@
mem_sys_free(name);
mem_sys_free((yyvsp[(2) - (4)].s));
mem_sys_free((yyvsp[(4) - (4)].s));
- ;}
+ }
break;
case 42:
#line 1305 "compilers/imcc/imcc.y"
- { (yyval.i) = 0;;}
+ { (yyval.i) = 0;}
break;
case 44:
#line 1313 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); ;}
+ { IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM); }
break;
case 45:
@@ -3470,7 +3470,7 @@
emit_flush(interp);
*/
(yyval.i) = 0;
- ;}
+ }
break;
case 48:
@@ -3485,33 +3485,33 @@
IMCC_INFO(interp)->cur_namespace = (yyvsp[(2) - (3)].sr);
if (re_open)
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PASM);
- ;}
+ }
break;
case 49:
#line 1347 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(2) - (3)].sr);
- ;}
+ }
break;
case 50:
#line 1350 "compilers/imcc/imcc.y"
- { (yyval.sr) = NULL; ;}
+ { (yyval.sr) = NULL; }
break;
case 51:
#line 1355 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->cur_unit = imc_open_unit(interp, IMC_PCCSUB);
- ;}
+ }
break;
case 52:
#line 1359 "compilers/imcc/imcc.y"
{
iSUBROUTINE(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(3) - (3)].sr));
- ;}
+ }
break;
case 53:
@@ -3522,22 +3522,22 @@
IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid = mem_sys_strdup(
IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->name);
}
- ;}
+ }
break;
case 54:
#line 1371 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
+ { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 55:
#line 1375 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 56:
#line 1376 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 57:
@@ -3550,17 +3550,17 @@
}
else
add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
- ;}
+ }
break;
case 58:
#line 1390 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 59:
#line 1390 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(3) - (3)].sr); IMCC_INFO(interp)->is_def = 0; ;}
+ { (yyval.sr) = (yyvsp[(3) - (3)].sr); IMCC_INFO(interp)->is_def = 0; }
break;
case 60:
@@ -3572,12 +3572,12 @@
(yyval.sr) = mk_ident(interp, (yyvsp[(2) - (3)].s), (yyvsp[(1) - (3)].t));
(yyval.sr)->type |= (yyvsp[(3) - (3)].t);
mem_sys_free((yyvsp[(2) - (3)].s));
- ;}
+ }
break;
case 61:
#line 1408 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 62:
@@ -3586,7 +3586,7 @@
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->outer = mk_sub_address_fromc(interp, (yyvsp[(3) - (4)].s));
mem_sys_free((yyvsp[(3) - (4)].s));
- ;}
+ }
break;
case 63:
@@ -3595,7 +3595,7 @@
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->outer = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
mem_sys_free((yyvsp[(3) - (4)].s));
- ;}
+ }
break;
case 64:
@@ -3604,7 +3604,7 @@
(yyval.t) = P_VTABLE;
IMCC_INFO(interp)->cur_unit->vtable_name = NULL;
IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
- ;}
+ }
break;
case 65:
@@ -3613,7 +3613,7 @@
(yyval.t) = P_VTABLE;
IMCC_INFO(interp)->cur_unit->vtable_name = (yyvsp[(3) - (4)].s);
IMCC_INFO(interp)->cur_unit->is_vtable_method = 1;
- ;}
+ }
break;
case 66:
@@ -3622,7 +3622,7 @@
(yyval.t) = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = NULL;
IMCC_INFO(interp)->cur_unit->is_method = 1;
- ;}
+ }
break;
case 67:
@@ -3631,7 +3631,7 @@
(yyval.t) = P_METHOD;
IMCC_INFO(interp)->cur_unit->method_name = (yyvsp[(3) - (4)].s);
IMCC_INFO(interp)->cur_unit->is_method = 1;
- ;}
+ }
break;
case 68:
@@ -3640,7 +3640,7 @@
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->ns_entry_name = NULL;
IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1;
- ;}
+ }
break;
case 69:
@@ -3649,7 +3649,7 @@
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->ns_entry_name = (yyvsp[(3) - (4)].s);
IMCC_INFO(interp)->cur_unit->has_ns_entry_name = 1;
- ;}
+ }
break;
case 70:
@@ -3657,7 +3657,7 @@
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->instance_of = (yyvsp[(3) - (4)].s);
- ;}
+ }
break;
case 71:
@@ -3665,7 +3665,7 @@
{
(yyval.t) = 0;
IMCC_INFO(interp)->cur_unit->subid = NULL;
- ;}
+ }
break;
case 72:
@@ -3675,14 +3675,14 @@
IMCC_INFO(interp)->cur_unit->subid = mk_const(interp, (yyvsp[(3) - (4)].s), 'S');
IMCC_INFO(interp)->cur_unit->instructions->symregs[0]->subid = str_dup_remove_quotes((yyvsp[(3) - (4)].s));
mem_sys_free((yyvsp[(3) - (4)].s));
- ;}
+ }
break;
case 73:
#line 1496 "compilers/imcc/imcc.y"
{
add_pcc_multi(IMCC_INFO(interp)->cur_call, NULL);
- ;}
+ }
break;
case 74:
@@ -3690,7 +3690,7 @@
{
(yyval.t) = 0;
add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
- ;}
+ }
break;
case 75:
@@ -3698,27 +3698,27 @@
{
(yyval.t) = 0;
add_pcc_multi(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
- ;}
+ }
break;
case 76:
#line 1512 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, "INTVAL", 'S'); ;}
+ { (yyval.sr) = mk_const(interp, "INTVAL", 'S'); }
break;
case 77:
#line 1513 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); ;}
+ { (yyval.sr) = mk_const(interp, "FLOATVAL", 'S'); }
break;
case 78:
#line 1514 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, "PMC", 'S'); ;}
+ { (yyval.sr) = mk_const(interp, "PMC", 'S'); }
break;
case 79:
#line 1515 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, "STRING", 'S'); ;}
+ { (yyval.sr) = mk_const(interp, "STRING", 'S'); }
break;
case 80:
@@ -3732,7 +3732,7 @@
}
mem_sys_free((yyvsp[(1) - (1)].s));
(yyval.sr) = r;
- ;}
+ }
break;
case 81:
@@ -3746,12 +3746,12 @@
}
mem_sys_free((yyvsp[(1) - (1)].s));
(yyval.sr) = r;
- ;}
+ }
break;
case 82:
#line 1538 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(2) - (3)].sr); ;}
+ { (yyval.sr) = (yyvsp[(2) - (3)].sr); }
break;
case 85:
@@ -3778,82 +3778,82 @@
r1 = IMCC_INFO(interp)->cur_unit->instructions->symregs[0];
if (r1 && r1->pcc_sub)
r1->pcc_sub->calls_a_sub |= 1;
- ;}
+ }
break;
case 86:
#line 1576 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
+ { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 87:
#line 1580 "compilers/imcc/imcc.y"
- { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; ;}
+ { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 0; }
break;
case 88:
#line 1581 "compilers/imcc/imcc.y"
- { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; ;}
+ { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->label = 1; }
break;
case 89:
#line 1585 "compilers/imcc/imcc.y"
- { (yyval.i) = NULL; ;}
+ { (yyval.i) = NULL; }
break;
case 90:
#line 1586 "compilers/imcc/imcc.y"
- { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); ;}
+ { (yyval.i) = NULL; IMCC_INFO(interp)->cur_call->pcc_sub->object = (yyvsp[(2) - (3)].sr); }
break;
case 91:
#line 1590 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 93:
#line 1595 "compilers/imcc/imcc.y"
- { (yyval.t) = (yyvsp[(1) - (1)].t); ;}
+ { (yyval.t) = (yyvsp[(1) - (1)].t); }
break;
case 94:
#line 1596 "compilers/imcc/imcc.y"
- { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
+ { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 95:
#line 1600 "compilers/imcc/imcc.y"
- { (yyval.t) = P_LOAD; ;}
+ { (yyval.t) = P_LOAD; }
break;
case 96:
#line 1601 "compilers/imcc/imcc.y"
- { (yyval.t) = P_INIT; ;}
+ { (yyval.t) = P_INIT; }
break;
case 97:
#line 1602 "compilers/imcc/imcc.y"
- { (yyval.t) = P_MAIN; ;}
+ { (yyval.t) = P_MAIN; }
break;
case 98:
#line 1603 "compilers/imcc/imcc.y"
- { (yyval.t) = P_IMMEDIATE; ;}
+ { (yyval.t) = P_IMMEDIATE; }
break;
case 99:
#line 1604 "compilers/imcc/imcc.y"
- { (yyval.t) = P_POSTCOMP; ;}
+ { (yyval.t) = P_POSTCOMP; }
break;
case 100:
#line 1605 "compilers/imcc/imcc.y"
- { (yyval.t) = P_ANON; ;}
+ { (yyval.t) = P_ANON; }
break;
case 101:
#line 1606 "compilers/imcc/imcc.y"
- { (yyval.t) = P_NEED_LEX; ;}
+ { (yyval.t) = P_NEED_LEX; }
break;
case 109:
@@ -3861,14 +3861,14 @@
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
- ;}
+ }
break;
case 110:
#line 1623 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
- ;}
+ }
break;
case 111:
@@ -3876,21 +3876,21 @@
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isNCI;
- ;}
+ }
break;
case 112:
#line 1632 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
- ;}
+ }
break;
case 113:
#line 1636 "compilers/imcc/imcc.y"
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (3)].s), 'S'));
- ;}
+ }
break;
case 114:
@@ -3898,7 +3898,7 @@
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (5)].sr));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
- ;}
+ }
break;
case 115:
@@ -3906,27 +3906,27 @@
{
add_pcc_sub(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(2) - (5)].s), 'S'));
add_pcc_cc(IMCC_INFO(interp)->cur_call, (yyvsp[(4) - (5)].sr));
- ;}
+ }
break;
case 116:
#line 1653 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 117:
#line 1654 "compilers/imcc/imcc.y"
- { add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); ;}
+ { add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr)); }
break;
case 118:
#line 1658 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(2) - (2)].sr); ;}
+ { (yyval.sr) = (yyvsp[(2) - (2)].sr); }
break;
case 119:
#line 1663 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 120:
@@ -3934,17 +3934,17 @@
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(2) - (3)].sr));
- ;}
+ }
break;
case 121:
#line 1672 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
+ { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 122:
#line 1673 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 123:
@@ -3959,62 +3959,62 @@
UNUSED(ignored);
IMCC_INFO(interp)->is_def = 0;
(yyval.sr) = 0;
- ;}
+ }
break;
case 124:
#line 1688 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 125:
#line 1689 "compilers/imcc/imcc.y"
- { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
+ { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 126:
#line 1693 "compilers/imcc/imcc.y"
- { (yyval.t) = VT_FLAT; ;}
+ { (yyval.t) = VT_FLAT; }
break;
case 127:
#line 1694 "compilers/imcc/imcc.y"
- { (yyval.t) = VT_OPTIONAL; ;}
+ { (yyval.t) = VT_OPTIONAL; }
break;
case 128:
#line 1695 "compilers/imcc/imcc.y"
- { (yyval.t) = VT_OPT_FLAG; ;}
+ { (yyval.t) = VT_OPT_FLAG; }
break;
case 129:
#line 1696 "compilers/imcc/imcc.y"
- { (yyval.t) = VT_NAMED; ;}
+ { (yyval.t) = VT_NAMED; }
break;
case 130:
#line 1697 "compilers/imcc/imcc.y"
- { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;}
+ { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); }
break;
case 131:
#line 1698 "compilers/imcc/imcc.y"
- { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); ;}
+ { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; mem_sys_free((yyvsp[(3) - (4)].s)); }
break;
case 132:
#line 1699 "compilers/imcc/imcc.y"
- { (yyval.t) = VT_UNIQUE_REG; ;}
+ { (yyval.t) = VT_UNIQUE_REG; }
break;
case 133:
#line 1704 "compilers/imcc/imcc.y"
- { begin_return_or_yield(interp, 0); ;}
+ { begin_return_or_yield(interp, 0); }
break;
case 134:
#line 1706 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;}
+ { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 135:
@@ -4022,22 +4022,22 @@
{
IMCC_INFO(interp)->asm_state = AsmDefault;
(yyval.i) = 0;
- ;}
+ }
break;
case 136:
#line 1715 "compilers/imcc/imcc.y"
- { begin_return_or_yield(interp, 1); ;}
+ { begin_return_or_yield(interp, 1); }
break;
case 137:
#line 1717 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; ;}
+ { (yyval.i) = 0; IMCC_INFO(interp)->asm_state = AsmDefault; }
break;
case 138:
#line 1721 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 139:
@@ -4045,7 +4045,7 @@
{
if ((yyvsp[(1) - (2)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
- ;}
+ }
break;
case 140:
@@ -4053,12 +4053,12 @@
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
- ;}
+ }
break;
case 141:
#line 1735 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 142:
@@ -4066,7 +4066,7 @@
{
if ((yyvsp[(1) - (2)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (2)].sr));
- ;}
+ }
break;
case 143:
@@ -4074,17 +4074,17 @@
{
if ((yyvsp[(2) - (3)].sr))
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(2) - (3)].sr));
- ;}
+ }
break;
case 144:
#line 1749 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
+ { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 145:
#line 1753 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); ;}
+ { (yyval.sr) = (yyvsp[(2) - (3)].sr); (yyval.sr)->type |= (yyvsp[(3) - (3)].t); }
break;
case 146:
@@ -4092,7 +4092,7 @@
{
if (IMCC_INFO(interp)->asm_state == AsmDefault)
begin_return_or_yield(interp, (yyvsp[(1) - (2)].t));
- ;}
+ }
break;
case 147:
@@ -4100,22 +4100,22 @@
{
IMCC_INFO(interp)->asm_state = AsmDefault;
(yyval.t) = 0;
- ;}
+ }
break;
case 148:
#line 1770 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 149:
#line 1771 "compilers/imcc/imcc.y"
- { (yyval.t) = 1; ;}
+ { (yyval.t) = 1; }
break;
case 150:
#line 1775 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 151:
@@ -4128,7 +4128,7 @@
}
else
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(1) - (1)].sr));
- ;}
+ }
break;
case 152:
@@ -4136,7 +4136,7 @@
{
SymReg * const name = mk_const(interp, (yyvsp[(1) - (3)].s), 'S');
add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(3) - (3)].sr));
- ;}
+ }
break;
case 153:
@@ -4149,7 +4149,7 @@
}
else
add_pcc_result(IMCC_INFO(interp)->sr_return, (yyvsp[(3) - (3)].sr));
- ;}
+ }
break;
case 154:
@@ -4157,47 +4157,47 @@
{
SymReg * const name = mk_const(interp, (yyvsp[(3) - (5)].s), 'S');
add_pcc_named_return(IMCC_INFO(interp)->sr_return, name, (yyvsp[(5) - (5)].sr));
- ;}
+ }
break;
case 157:
#line 1823 "compilers/imcc/imcc.y"
- { clear_state(interp); ;}
+ { clear_state(interp); }
break;
case 158:
#line 1828 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(2) - (2)].i); ;}
+ { (yyval.i) = (yyvsp[(2) - (2)].i); }
break;
case 159:
#line 1829 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 160:
#line 1830 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 161:
#line 1831 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 162:
#line 1832 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 163:
#line 1833 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+ { (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 164:
#line 1837 "compilers/imcc/imcc.y"
- { (yyval.i) = NULL; ;}
+ { (yyval.i) = NULL; }
break;
case 168:
@@ -4206,12 +4206,12 @@
Instruction * const i = iLABEL(interp, IMCC_INFO(interp)->cur_unit, mk_local_label(interp, (yyvsp[(1) - (1)].s)));
mem_sys_free((yyvsp[(1) - (1)].s));
(yyval.i) = i;
- ;}
+ }
break;
case 169:
#line 1858 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(2) - (3)].i); ;}
+ { (yyval.i) = (yyvsp[(2) - (3)].i); }
break;
case 170:
@@ -4222,7 +4222,7 @@
YYABORT;
}
yyerrok;
- ;}
+ }
break;
case 171:
@@ -4231,7 +4231,7 @@
IdList* const l = (yyvsp[(1) - (1)].idlist);
l->next = NULL;
(yyval.idlist) = l;
- ;}
+ }
break;
case 172:
@@ -4240,7 +4240,7 @@
IdList* const l = (yyvsp[(3) - (3)].idlist);
l->next = (yyvsp[(1) - (3)].idlist);
(yyval.idlist) = l;
- ;}
+ }
break;
case 173:
@@ -4250,22 +4250,22 @@
l->id = (yyvsp[(1) - (2)].s);
l->unique_reg = (yyvsp[(2) - (2)].t);
(yyval.idlist) = l;
- ;}
+ }
break;
case 174:
#line 1896 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 175:
#line 1897 "compilers/imcc/imcc.y"
- { (yyval.t) = 1; ;}
+ { (yyval.t) = 1; }
break;
case 178:
#line 1904 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 179:
@@ -4284,7 +4284,7 @@
mem_sys_free(l1);
}
IMCC_INFO(interp)->is_def = 0; (yyval.i) = 0;
- ;}
+ }
break;
case 180:
@@ -4297,7 +4297,7 @@
set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
mem_sys_free((yyvsp[(2) - (4)].s));
mem_sys_free(name);
- ;}
+ }
break;
case 181:
@@ -4306,12 +4306,12 @@
SymReg *n = mk_const(interp, (yyvsp[(2) - (4)].s), 'U');
set_lexical(interp, (yyvsp[(4) - (4)].sr), n); (yyval.i) = 0;
mem_sys_free((yyvsp[(2) - (4)].s));
- ;}
+ }
break;
case 182:
#line 1936 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 183:
@@ -4320,12 +4320,12 @@
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 0);
IMCC_INFO(interp)->is_def = 0;
mem_sys_free((yyvsp[(4) - (6)].s));
- ;}
+ }
break;
case 185:
#line 1944 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->is_def = 1; ;}
+ { IMCC_INFO(interp)->is_def = 1; }
break;
case 186:
@@ -4334,7 +4334,7 @@
mk_const_ident(interp, (yyvsp[(4) - (6)].s), (yyvsp[(3) - (6)].t), (yyvsp[(6) - (6)].sr), 1);
IMCC_INFO(interp)->is_def = 0;
mem_sys_free((yyvsp[(4) - (6)].s));
- ;}
+ }
break;
case 187:
@@ -4343,14 +4343,14 @@
(yyval.i) = NULL;
IMCC_INFO(interp)->cur_call->pcc_sub->flags |= isTAIL_CALL;
IMCC_INFO(interp)->cur_call = NULL;
- ;}
+ }
break;
case 188:
#line 1957 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "branch", 1, (yyvsp[(2) - (2)].sr));
- ;}
+ }
break;
case 189:
@@ -4365,47 +4365,47 @@
IMCC_INFO(interp)->keyvec,
1);
mem_sys_free((yyvsp[(1) - (2)].s));
- ;}
+ }
break;
case 190:
#line 1972 "compilers/imcc/imcc.y"
- { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); ;}
+ { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(2) - (2)].sr)); }
break;
case 191:
#line 1973 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; ;}
+ { (yyval.i) = 0; IMCC_INFO(interp)->cur_call = NULL; }
break;
case 192:
#line 1974 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 195:
#line 1977 "compilers/imcc/imcc.y"
- { (yyval.i) = 0;;}
+ { (yyval.i) = 0;}
break;
case 196:
#line 1981 "compilers/imcc/imcc.y"
- { (yyval.t) = 'I'; ;}
+ { (yyval.t) = 'I'; }
break;
case 197:
#line 1982 "compilers/imcc/imcc.y"
- { (yyval.t) = 'N'; ;}
+ { (yyval.t) = 'N'; }
break;
case 198:
#line 1983 "compilers/imcc/imcc.y"
- { (yyval.t) = 'S'; ;}
+ { (yyval.t) = 'S'; }
break;
case 199:
#line 1984 "compilers/imcc/imcc.y"
- { (yyval.t) = 'P'; ;}
+ { (yyval.t) = 'P'; }
break;
case 200:
@@ -4418,37 +4418,37 @@
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
"Unknown PMC type '%s'\n", (yyvsp[(1) - (1)].s));
}
- ;}
+ }
break;
case 201:
#line 2002 "compilers/imcc/imcc.y"
- { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); ;}
+ { (yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "set", 2, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr)); }
break;
case 202:
#line 2004 "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)); ;}
+ { (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 203:
#line 2006 "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)); ;}
+ { (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 204:
#line 2008 "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)); ;}
+ { (yyval.i) = iINDEXFETCH(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(5) - (6)].sr)); }
break;
case 205:
#line 2010 "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)); ;}
+ { (yyval.i) = iINDEXSET(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (6)].sr), (yyvsp[(3) - (6)].sr), (yyvsp[(6) - (6)].sr)); }
break;
case 206:
#line 2015 "compilers/imcc/imcc.y"
- { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); ;}
+ { (yyval.i) = iNEW(interp, IMCC_INFO(interp)->cur_unit, (yyvsp[(1) - (7)].sr), (yyvsp[(4) - (7)].s), (yyvsp[(6) - (7)].sr), 1); }
break;
case 207:
@@ -4457,14 +4457,14 @@
add_pcc_result((yyvsp[(3) - (3)].i)->symregs[0], (yyvsp[(1) - (3)].sr));
IMCC_INFO(interp)->cur_call = NULL;
(yyval.i) = 0;
- ;}
+ }
break;
case 208:
#line 2024 "compilers/imcc/imcc.y"
{
(yyval.i) = IMCC_create_itcall_label(interp);
- ;}
+ }
break;
case 209:
@@ -4472,144 +4472,144 @@
{
IMCC_itcall_sub(interp, (yyvsp[(6) - (9)].sr));
IMCC_INFO(interp)->cur_call = NULL;
- ;}
+ }
break;
case 213:
#line 2036 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "null", 1, (yyvsp[(1) - (3)].sr));
- ;}
+ }
break;
case 214:
#line 2043 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"not"; ;}
+ { (yyval.s) = (char *)"not"; }
break;
case 215:
#line 2044 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"bnot"; ;}
+ { (yyval.s) = (char *)"bnot"; }
break;
case 216:
#line 2045 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"neg"; ;}
+ { (yyval.s) = (char *)"neg"; }
break;
case 217:
#line 2049 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"sub"; ;}
+ { (yyval.s) = (char *)"sub"; }
break;
case 218:
#line 2050 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"add"; ;}
+ { (yyval.s) = (char *)"add"; }
break;
case 219:
#line 2051 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"mul"; ;}
+ { (yyval.s) = (char *)"mul"; }
break;
case 220:
#line 2052 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"div"; ;}
+ { (yyval.s) = (char *)"div"; }
break;
case 221:
#line 2053 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"mod"; ;}
+ { (yyval.s) = (char *)"mod"; }
break;
case 222:
#line 2054 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"fdiv"; ;}
+ { (yyval.s) = (char *)"fdiv"; }
break;
case 223:
#line 2055 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"pow"; ;}
+ { (yyval.s) = (char *)"pow"; }
break;
case 224:
#line 2056 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"concat"; ;}
+ { (yyval.s) = (char *)"concat"; }
break;
case 225:
#line 2057 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"iseq"; ;}
+ { (yyval.s) = (char *)"iseq"; }
break;
case 226:
#line 2058 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"isne"; ;}
+ { (yyval.s) = (char *)"isne"; }
break;
case 227:
#line 2059 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"isgt"; ;}
+ { (yyval.s) = (char *)"isgt"; }
break;
case 228:
#line 2060 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"isge"; ;}
+ { (yyval.s) = (char *)"isge"; }
break;
case 229:
#line 2061 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"islt"; ;}
+ { (yyval.s) = (char *)"islt"; }
break;
case 230:
#line 2062 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"isle"; ;}
+ { (yyval.s) = (char *)"isle"; }
break;
case 231:
#line 2063 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"shl"; ;}
+ { (yyval.s) = (char *)"shl"; }
break;
case 232:
#line 2064 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"shr"; ;}
+ { (yyval.s) = (char *)"shr"; }
break;
case 233:
#line 2065 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"lsr"; ;}
+ { (yyval.s) = (char *)"lsr"; }
break;
case 234:
#line 2066 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"and"; ;}
+ { (yyval.s) = (char *)"and"; }
break;
case 235:
#line 2067 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"or"; ;}
+ { (yyval.s) = (char *)"or"; }
break;
case 236:
#line 2068 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"xor"; ;}
+ { (yyval.s) = (char *)"xor"; }
break;
case 237:
#line 2069 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"band"; ;}
+ { (yyval.s) = (char *)"band"; }
break;
case 238:
#line 2070 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"bor"; ;}
+ { (yyval.s) = (char *)"bor"; }
break;
case 239:
#line 2071 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"bxor"; ;}
+ { (yyval.s) = (char *)"bxor"; }
break;
case 240:
@@ -4618,84 +4618,84 @@
(yyval.i) = IMCC_create_itcall_label(interp);
(yyval.i)->type &= ~ITCALL;
(yyval.i)->type |= ITRESULT;
- ;}
+ }
break;
case 241:
#line 2082 "compilers/imcc/imcc.y"
- { (yyval.i) = 0; ;}
+ { (yyval.i) = 0; }
break;
case 242:
#line 2089 "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 243:
#line 2095 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"add"; ;}
+ { (yyval.s) = (char *)"add"; }
break;
case 244:
#line 2096 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"sub"; ;}
+ { (yyval.s) = (char *)"sub"; }
break;
case 245:
#line 2097 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"mul"; ;}
+ { (yyval.s) = (char *)"mul"; }
break;
case 246:
#line 2098 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"div"; ;}
+ { (yyval.s) = (char *)"div"; }
break;
case 247:
#line 2099 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"mod"; ;}
+ { (yyval.s) = (char *)"mod"; }
break;
case 248:
#line 2100 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"fdiv"; ;}
+ { (yyval.s) = (char *)"fdiv"; }
break;
case 249:
#line 2101 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"concat"; ;}
+ { (yyval.s) = (char *)"concat"; }
break;
case 250:
#line 2102 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"band"; ;}
+ { (yyval.s) = (char *)"band"; }
break;
case 251:
#line 2103 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"bor"; ;}
+ { (yyval.s) = (char *)"bor"; }
break;
case 252:
#line 2104 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"bxor"; ;}
+ { (yyval.s) = (char *)"bxor"; }
break;
case 253:
#line 2105 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"shr"; ;}
+ { (yyval.s) = (char *)"shr"; }
break;
case 254:
#line 2106 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"shl"; ;}
+ { (yyval.s) = (char *)"shl"; }
break;
case 255:
#line 2107 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"lsr"; ;}
+ { (yyval.s) = (char *)"lsr"; }
break;
case 256:
@@ -4706,22 +4706,22 @@
IMCC_INFO(interp) -> nargs,
IMCC_INFO(interp) -> keyvec, 1);
mem_sys_free((yyvsp[(3) - (4)].s));
- ;}
+ }
break;
case 257:
#line 2123 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 258:
#line 2124 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 259:
#line 2125 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 260:
@@ -4730,7 +4730,7 @@
(yyval.sr) = (yyvsp[(1) - (1)].sr);
if ((yyvsp[(1) - (1)].sr)->set != 'P')
IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "Sub isn't a PMC");
- ;}
+ }
break;
case 261:
@@ -4747,7 +4747,7 @@
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
(yyval.sr) = (yyvsp[(3) - (3)].sr);
- ;}
+ }
break;
case 262:
@@ -4756,7 +4756,7 @@
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
(yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'U');
mem_sys_free((yyvsp[(3) - (3)].s));
- ;}
+ }
break;
case 263:
@@ -4765,12 +4765,12 @@
IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr);
(yyval.sr) = mk_const(interp, (yyvsp[(3) - (3)].s), 'S');
mem_sys_free((yyvsp[(3) - (3)].s));
- ;}
+ }
break;
case 264:
#line 2158 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); ;}
+ { IMCC_INFO(interp)->cur_obj = (yyvsp[(1) - (3)].sr); (yyval.sr) = (yyvsp[(3) - (3)].sr); }
break;
case 265:
@@ -4778,17 +4778,17 @@
{
(yyval.i) = IMCC_create_itcall_label(interp);
IMCC_itcall_sub(interp, (yyvsp[(1) - (1)].sr));
- ;}
+ }
break;
case 266:
#line 2168 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(2) - (5)].i); ;}
+ { (yyval.i) = (yyvsp[(2) - (5)].i); }
break;
case 267:
#line 2172 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 268:
@@ -4801,7 +4801,7 @@
}
else
add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
- ;}
+ }
break;
case 269:
@@ -4814,7 +4814,7 @@
}
else
add_pcc_arg(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
- ;}
+ }
break;
case 270:
@@ -4824,7 +4824,7 @@
add_pcc_named_arg(IMCC_INFO(interp)->cur_call,
mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr));
mem_sys_free((yyvsp[(3) - (5)].s));
- ;}
+ }
break;
case 271:
@@ -4832,7 +4832,7 @@
{
(yyval.sr) = 0;
add_pcc_named_arg_var(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (3)].sr), (yyvsp[(3) - (3)].sr));
- ;}
+ }
break;
case 272:
@@ -4842,47 +4842,47 @@
add_pcc_named_arg(IMCC_INFO(interp)->cur_call,
mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr));
mem_sys_free((yyvsp[(1) - (3)].s));
- ;}
+ }
break;
case 273:
#line 2215 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;}
+ { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
break;
case 274:
#line 2219 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 275:
#line 2220 "compilers/imcc/imcc.y"
- { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); ;}
+ { (yyval.t) = (yyvsp[(1) - (2)].t) | (yyvsp[(2) - (2)].t); }
break;
case 276:
#line 2224 "compilers/imcc/imcc.y"
- { (yyval.t) = VT_FLAT; ;}
+ { (yyval.t) = VT_FLAT; }
break;
case 277:
#line 2225 "compilers/imcc/imcc.y"
- { (yyval.t) = VT_NAMED; ;}
+ { (yyval.t) = VT_NAMED; }
break;
case 278:
#line 2228 "compilers/imcc/imcc.y"
- { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; ;}
+ { adv_named_set_u(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
case 279:
#line 2229 "compilers/imcc/imcc.y"
- { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; ;}
+ { adv_named_set(interp, (yyvsp[(3) - (4)].s)); (yyval.t) = 0; }
break;
case 280:
#line 2233 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); ;}
+ { (yyval.sr) = (yyvsp[(1) - (2)].sr); (yyval.sr)->type |= (yyvsp[(2) - (2)].t); }
break;
case 281:
@@ -4895,7 +4895,7 @@
}
else
add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(3) - (3)].sr));
- ;}
+ }
break;
case 282:
@@ -4904,7 +4904,7 @@
add_pcc_named_result(IMCC_INFO(interp)->cur_call,
mk_const(interp, (yyvsp[(3) - (5)].s), 'S'), (yyvsp[(5) - (5)].sr));
mem_sys_free((yyvsp[(3) - (5)].s));
- ;}
+ }
break;
case 283:
@@ -4917,7 +4917,7 @@
}
else
add_pcc_result(IMCC_INFO(interp)->cur_call, (yyvsp[(1) - (1)].sr));
- ;}
+ }
break;
case 284:
@@ -4925,124 +4925,124 @@
{
add_pcc_named_result(IMCC_INFO(interp)->cur_call, mk_const(interp, (yyvsp[(1) - (3)].s), 'S'), (yyvsp[(3) - (3)].sr));
mem_sys_free((yyvsp[(1) - (3)].s));
- ;}
+ }
break;
case 285:
#line 2268 "compilers/imcc/imcc.y"
- { (yyval.sr) = 0; ;}
+ { (yyval.sr) = 0; }
break;
case 286:
#line 2272 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+ { (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 287:
#line 2273 "compilers/imcc/imcc.y"
- { (yyval.i) = (yyvsp[(1) - (1)].i); ;}
+ { (yyval.i) = (yyvsp[(1) - (1)].i); }
break;
case 288:
#line 2278 "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));
- ;}
+ }
break;
case 289:
#line 2282 "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));
- ;}
+ }
break;
case 290:
#line 2286 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "unless", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
- ;}
+ }
break;
case 291:
#line 2293 "compilers/imcc/imcc.y"
{
(yyval.i) = MK_I(interp, IMCC_INFO(interp)->cur_unit, "if", 2, (yyvsp[(2) - (4)].sr), (yyvsp[(4) - (4)].sr));
- ;}
+ }
break;
case 292:
#line 2297 "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));
- ;}
+ }
break;
case 293:
#line 2301 "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));
- ;}
+ }
break;
case 294:
#line 2307 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 295:
#line 2308 "compilers/imcc/imcc.y"
- { (yyval.t) = 0; ;}
+ { (yyval.t) = 0; }
break;
case 296:
#line 2312 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"eq"; ;}
+ { (yyval.s) = (char *)"eq"; }
break;
case 297:
#line 2313 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"ne"; ;}
+ { (yyval.s) = (char *)"ne"; }
break;
case 298:
#line 2314 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"gt"; ;}
+ { (yyval.s) = (char *)"gt"; }
break;
case 299:
#line 2315 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"ge"; ;}
+ { (yyval.s) = (char *)"ge"; }
break;
case 300:
#line 2316 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"lt"; ;}
+ { (yyval.s) = (char *)"lt"; }
break;
case 301:
#line 2317 "compilers/imcc/imcc.y"
- { (yyval.s) = (char *)"le"; ;}
+ { (yyval.s) = (char *)"le"; }
break;
case 304:
#line 2326 "compilers/imcc/imcc.y"
- { (yyval.sr) = NULL; ;}
+ { (yyval.sr) = NULL; }
break;
case 305:
#line 2327 "compilers/imcc/imcc.y"
- { (yyval.sr) = (yyvsp[(1) - (1)].sr); ;}
+ { (yyval.sr) = (yyvsp[(1) - (1)].sr); }
break;
case 306:
#line 2331 "compilers/imcc/imcc.y"
- { (yyval.sr) = IMCC_INFO(interp)->regs[0]; ;}
+ { (yyval.sr) = IMCC_INFO(interp)->regs[0]; }
break;
case 308:
#line 2336 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); ;}
+ { IMCC_INFO(interp)->regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(1) - (1)].sr); }
break;
case 309:
@@ -5052,7 +5052,7 @@
IMCC_INFO(interp) -> keyvec |= KEY_BIT(IMCC_INFO(interp)->nargs);
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(3) - (4)].sr);
(yyval.sr) = (yyvsp[(1) - (4)].sr);
- ;}
+ }
break;
case 310:
@@ -5060,44 +5060,44 @@
{
IMCC_INFO(interp) -> regs[IMCC_INFO(interp)->nargs++] = (yyvsp[(2) - (3)].sr);
(yyval.sr) = (yyvsp[(2) - (3)].sr);
- ;}
+ }
break;
case 312:
#line 2352 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_sub_address_fromc(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 313:
#line 2353 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_sub_address_u(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 314:
#line 2357 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 315:
#line 2358 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_sub_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 316:
#line 2362 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 317:
#line 2363 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_label_address(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 322:
#line 2377 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
- ;}
+ }
break;
case 323:
@@ -5106,14 +5106,14 @@
(yyval.sr) = link_keys(interp,
IMCC_INFO(interp)->nkeys,
IMCC_INFO(interp)->keys, 0);
- ;}
+ }
break;
case 324:
#line 2389 "compilers/imcc/imcc.y"
{
IMCC_INFO(interp)->nkeys = 0;
- ;}
+ }
break;
case 325:
@@ -5122,12 +5122,12 @@
(yyval.sr) = link_keys(interp,
IMCC_INFO(interp)->nkeys,
IMCC_INFO(interp)->keys, 1);
- ;}
+ }
break;
case 326:
#line 2401 "compilers/imcc/imcc.y"
- { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); ;}
+ { IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(1) - (1)].sr); }
break;
case 327:
@@ -5135,59 +5135,59 @@
{
IMCC_INFO(interp)->keys[IMCC_INFO(interp)->nkeys++] = (yyvsp[(3) - (3)].sr);
(yyval.sr) = IMCC_INFO(interp)->keys[0];
- ;}
+ }
break;
case 328:
#line 2411 "compilers/imcc/imcc.y"
{
(yyval.sr) = (yyvsp[(1) - (1)].sr);
- ;}
+ }
break;
case 329:
#line 2417 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); ;}
+ { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'I'); }
break;
case 330:
#line 2418 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); ;}
+ { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'N'); }
break;
case 331:
#line 2419 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); ;}
+ { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'S'); }
break;
case 332:
#line 2420 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); ;}
+ { (yyval.sr) = mk_symreg(interp, (yyvsp[(1) - (1)].s), 'P'); }
break;
case 333:
#line 2421 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_pasm_reg(interp, (yyvsp[(1) - (1)].s)); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 334:
#line 2425 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'I'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 335:
#line 2426 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'N'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 336:
#line 2427 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'S'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
case 337:
#line 2428 "compilers/imcc/imcc.y"
- { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); ;}
+ { (yyval.sr) = mk_const(interp, (yyvsp[(1) - (1)].s), 'U'); mem_sys_free((yyvsp[(1) - (1)].s)); }
break;
Modified: branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/compilers/pct/src/PAST/Compiler.pir Thu Aug 27 18:38:59 2009 (r40830)
@@ -83,6 +83,7 @@
piropsig['print'] = 'v*'
piropsig['set'] = 'PP'
piropsig['setprop'] = '0P~P'
+ piropsig['setattribute'] = '0P~P'
set_global '%piropsig', piropsig
## %valflags specifies when PAST::Val nodes are allowed to
@@ -2253,8 +2254,13 @@
.tailcall self.'vivify'(node, ops, fetchop, storeop)
attribute_bind:
- $P0 = get_hll_global ['POST'], 'Op'
- .tailcall $P0.'new'(call_on, name, bindpost, 'pirop'=>'setattribute', 'result'=>bindpost)
+ $P0 = get_hll_global ['POST'], 'Ops'
+ $P0 = $P0.'new'()
+ $P0.'push'(call_on)
+ $P1 = get_hll_global ['POST'], 'Op'
+ $P1 = $P1.'new'(call_on, name, bindpost, 'pirop'=>'setattribute', 'result'=>bindpost)
+ $P0.'push'($P1)
+ .return ($P0)
.end
Modified: branches/pluggable_runcore/compilers/pge/PGE/Match.pir
==============================================================================
--- branches/pluggable_runcore/compilers/pge/PGE/Match.pir Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/compilers/pge/PGE/Match.pir Thu Aug 27 18:38:59 2009 (r40830)
@@ -243,7 +243,7 @@
=cut
.sub 'orig' :method
- $P0 = getattribute self, '$!target'
+ $P0 = getattribute self, '$.target'
.return ($P0)
.end
Modified: branches/pluggable_runcore/compilers/pirc/src/bcgen.c
==============================================================================
--- branches/pluggable_runcore/compilers/pirc/src/bcgen.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/compilers/pirc/src/bcgen.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -910,7 +910,7 @@
{
ASSERT_ARGS(find_outer_sub)
PMC *current;
- Parrot_sub *sub;
+ Parrot_Sub_attributes *sub;
STRING *cur_name;
size_t len;
global_label *outersub;
@@ -1131,7 +1131,7 @@
{
ASSERT_ARGS(add_sub_pmc)
PMC *sub_pmc; /* the "Sub" pmc, or a variant, such as "Coroutine" */
- Parrot_sub *sub;
+ Parrot_Sub_attributes *sub;
int subconst_index; /* index in const table for the sub pmc */
int subname_index;
int i; /* for loop iterator */
Modified: branches/pluggable_runcore/config/gen/makefiles/root.in
==============================================================================
--- branches/pluggable_runcore/config/gen/makefiles/root.in Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/gen/makefiles/root.in Thu Aug 27 18:38:59 2009 (r40830)
@@ -1772,6 +1772,7 @@
"t/op/*.pbc" \
"t/oo/*.pbc" \
"t/pmc/*.pbc" \
+ "t/dynpmc/*.pbc" \
"t/stress/*.pbc" \
"t/tools/*.pbc"
$(RM_F) \
Modified: branches/pluggable_runcore/config/init/hints/dec_osf.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/dec_osf.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/init/hints/dec_osf.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -11,7 +11,7 @@
# Tru64
my $ccflags = $conf->data->get('ccflags');
- if ( $ccflags !~ /-pthread/ ) {
+ if ( $ccflags !~ /-pthread\b/ ) {
$ccflags .= ' -pthread';
}
if ( $ccflags !~ /-D_REENTRANT/ ) {
@@ -24,7 +24,7 @@
$conf->data->set( ccflags => $ccflags );
my $libs = $conf->data->get('libs');
- if ( $libs !~ /-lpthread/ ) {
+ if ( $libs !~ /-lpthread\b/ ) {
$libs .= ' -lpthread';
}
$conf->data->set( libs => $libs );
@@ -37,7 +37,7 @@
}
my $linkflags = $conf->data->get('linkflags');
- if ( $linkflags !~ /-expect_unresolved/ ) {
+ if ( $linkflags !~ /-expect_unresolved\b/ ) {
$linkflags = "-expect_unresolved '*' -O4 -msym -std $linkflags";
$conf->data->set( linkflags => $linkflags );
}
Modified: branches/pluggable_runcore/config/init/hints/dragonfly.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/dragonfly.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/init/hints/dragonfly.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -13,7 +13,7 @@
my $version = $conf->option_or_data('VERSION');
my $libs = $conf->data->get('libs');
- $libs .= ' -pthread' unless $libs =~ /pthread/;
+ $libs .= ' -pthread' unless $libs =~ /pthread\b/;
$conf->data->set(
libs => $libs,
Modified: branches/pluggable_runcore/config/init/hints/hpux.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/hpux.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/init/hints/hpux.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -10,7 +10,7 @@
my ( $self, $conf ) = @_;
my $libs = $conf->data->get('libs');
- if ( $libs !~ /-lpthread/ ) {
+ if ( $libs !~ /-lpthread\b/ ) {
$libs .= ' -lpthread';
}
Modified: branches/pluggable_runcore/config/init/hints/irix.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/irix.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/init/hints/irix.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -21,7 +21,7 @@
$conf->data->set( ccflags => $ccflags );
my $libs = $conf->data->get('libs');
- if ( $libs !~ /-lpthread/ ) {
+ if ( $libs !~ /-lpthread\b/ ) {
$libs .= ' -lpthread';
}
$conf->data->set( libs => $libs );
Modified: branches/pluggable_runcore/config/init/hints/netbsd.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/netbsd.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/init/hints/netbsd.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -10,13 +10,13 @@
my ( $self, $conf ) = @_;
my $ccflags = $conf->data->get('ccflags');
- if ( $ccflags !~ /-pthread/ ) {
+ if ( $ccflags !~ /-pthread\b/ ) {
$ccflags .= ' -pthread';
}
$conf->data->set( ccflags => $ccflags );
my $libs = $conf->data->get('libs');
- if ( $libs !~ /-lpthread/ ) {
+ if ( $libs !~ /-lpthread\b/ ) {
$libs .= ' -lpthread';
}
$conf->data->set( libs => $libs );
Modified: branches/pluggable_runcore/config/init/hints/openbsd.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/openbsd.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/init/hints/openbsd.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -12,13 +12,13 @@
my $share_ext = $conf->option_or_data('share_ext');
my $version = $conf->option_or_data('VERSION');
my $ccflags = $conf->data->get('ccflags');
- if ( $ccflags !~ /-pthread/ ) {
+ if ( $ccflags !~ /-pthread\b/ ) {
$ccflags .= ' -pthread';
}
$conf->data->set( ccflags => $ccflags );
my $libs = $conf->data->get('libs');
- if ( $libs !~ /-lpthread/ ) {
+ if ( $libs !~ /-lpthread\b/ ) {
$libs .= ' -lpthread';
}
$conf->data->set(
Modified: branches/pluggable_runcore/config/init/hints/solaris.pm
==============================================================================
--- branches/pluggable_runcore/config/init/hints/solaris.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/config/init/hints/solaris.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -10,7 +10,7 @@
my ( $self, $conf ) = @_;
my $libs = $conf->data->get('libs');
- if ( $libs !~ /-lpthread/ ) {
+ if ( $libs !~ /-lpthread\b/ ) {
$libs .= ' -lpthread';
}
if ( $libs !~ /-lrt\b/ ) {
Modified: branches/pluggable_runcore/docs/book/draft/ch07_dynpmcs.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/draft/ch07_dynpmcs.pod Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/docs/book/draft/ch07_dynpmcs.pod Thu Aug 27 18:38:59 2009 (r40830)
@@ -88,11 +88,8 @@
file to refer to the parent type.
The C<FLAGS> are a series of flags that can be specified to determine
-how the PMC behaves and how it's constructed internally. The C<need_ext>
-flag assigns a special C<PMC_EXT> data structure to the PMC structure
-internally. C<PMC_EXT> is necessary to handle data sharing between threads
-or interpreters, storing attributes in the PMC, and a few other uses as
-well. The C<singleton> flag means that there can only be one instantiated
+how the PMC behaves and how it's constructed internally. The C<singleton>
+flag means that there can only be one instantiated
object of this class. The C<is_ro> and C<has_ro> flags indicate that the
PMC class is read-only or that it contains read-only data, respectively.
The C<is_shared> flag indicates that the PMC is intended to be shared
Modified: branches/pluggable_runcore/docs/book/pir/ch04_variables.pod
==============================================================================
--- branches/pluggable_runcore/docs/book/pir/ch04_variables.pod Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/docs/book/pir/ch04_variables.pod Thu Aug 27 18:38:59 2009 (r40830)
@@ -131,18 +131,18 @@
=head3 Floating-point operations
-The most common floating-point operations are C<ln>X<ln opcode> (natural
-log), C<log2>X<log2 opcode> (log base 2), C<log10>X<log10 opcode> (log
-base 10), and C<exp>X<exp opcode> (I<e>G<x>), as well as a full set of
-trigonometric opcodes such as C<sin>X<sin opcode> (sine), C<cos>X<cos
-opcode> (cosine), C<tan>X<tan opcode> (tangent), C<sec>X<sec opcode>
-(secant), C<cosh>X<cosh opcode> (hyperbolic cosine), C<tanh>X<tanh
+The most common floating-point operations are C<ln>X<ln opcode> (natural log),
+C<log2>X<log2 opcode> (log base 2), C<log10>X<log10 opcode> (log base 10), and
+C<exp>X<exp opcode> (I<e>G<x>), as well as a full set of trigonometric opcodes
+such as C<sin>X<sin opcode> (sine), C<cos>X<cos opcode> (cosine), C<tan>X<tan
+opcode> (tangent), C<sec>X<sec opcode> (secant), C<sinh>X<sinh opcode>
+(hyperbolic sine), C<cosh>X<cosh opcode> (hyperbolic cosine), C<tanh>X<tanh
opcode> (hyperbolic tangent), C<sech>X<sech opcode> (hyperbolic secant),
C<asin>X<asin opcode> (arc sine), C<acos>X<acos opcode> (arc cosine),
-C<atan>C<atan opcode> (arc tangent), C<asec>X<asec opcode> (arc secant),
+C<atan>X<atan opcode> (arc tangent), C<asec>X<asec opcode> (arc secant),
C<exsec>X<exsec opcode> (exsecant), C<hav>X<hav opcode> (haversine), and
-C<vers>X<vers opcode> (versine). All angle arguments for the
-X<trigonometric opcodes> trigonometric opcodes are in radians:
+C<vers>X<vers opcode> (versine). All angle arguments for the X<trigonometric
+opcodes> trigonometric opcodes are in radians:
=begin PIR_FRAGMENT
Modified: branches/pluggable_runcore/docs/pdds/pdd09_gc.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/pdd09_gc.pod Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/docs/pdds/pdd09_gc.pod Thu Aug 27 18:38:59 2009 (r40830)
@@ -299,8 +299,7 @@
The Arenas structure contains pointers to a variety of memory pools, each used
for a specific purpose. Two are Memory_Pool pointers (memory_pool,
constant_string_pool), and six are Small_Object_Pool structures (pmc_pool,
-pmc_ext_pool, constant_pmc_pool, buffer_header_pool,
-constant_string_header_pool).
+constant_pmc_pool, constant_string_header_pool).
The Arenas structure holds function pointers for the core defined interface of
the currently active GC subsystem: C<init_pool>, C<do_gc_mark>,
Modified: branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod
==============================================================================
--- branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/docs/pdds/pdd17_pmc.pod Thu Aug 27 18:38:59 2009 (r40830)
@@ -48,7 +48,9 @@
Parrot_UInt flags;
VTABLE *vtable;
DPOINTER *data;
- struct PMC_EXT *pmc_ext;
+ PMC *_metadata;
+ struct _Sync *_synchronize; # [Note: may be deprecated, see STM]
+ PMC *_next_for_GC;
};
where C<cache> is a C<UnionVal> union:
@@ -88,14 +90,6 @@
C<data> holds a pointer to the core data associated with the PMC. This
may be null.
-C<pmc_ext> points to an extended PMC structure. This has the form:
-
- struct PMC_EXT {
- PMC *_metadata;
- struct _Sync *_synchronize; # [Note: may be deprecated, see STM]
- PMC *_next_for_GC;
- };
-
C<_metadata> holds internal PMC metadata. The specification for this has not
yet been finalized.
@@ -104,9 +98,6 @@
C<_next_for_GC> determines the next PMC in the 'used' list during dead object
detection in the GC.
-PMCs are not required to have a C<PMC_EXT> structure (i.e. C<pmc_ext> can be
-null).
-
PMCs are used to implement the basic data types of the high level languages
running on top of Parrot. For instance, a Perl 5 C<SV> will map onto one (or
more) types of PMC, while particular Python datatypes will map onto different
@@ -123,10 +114,6 @@
=over 4
-=item need_ext
-
-Adds the C<PMC_EXT> structure when instantiating the PMC.
-
=item abstract
The PMC cannot be instantiated. (By convention, abstract classes are given
Modified: branches/pluggable_runcore/docs/pmc.pod
==============================================================================
--- branches/pluggable_runcore/docs/pmc.pod Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/docs/pmc.pod Thu Aug 27 18:38:59 2009 (r40830)
@@ -30,36 +30,6 @@
encapsulation and hidden dependencies between PMCs. Any new code should not
use the UnionVal, which will eventually be removed from Parrot.
-=head2 PMC_EXT
-
-C<PMC_EXT> is a member of the PMC struct which contains two currently used
-pointers. PMCs which need C<PMC_EXT> should have C<need_ext> in their
-C<pmclass> declaration. A PMC should declare C<need_ext> for either of the
-reasons listed below.
-
-Note that the C<_synchronize> member of the C<PMC_EXT> struct is obsolete and
-due to be removed.
-
-=over 4
-
-=item * The PMC needs metadata.
-
-The C<_metadata> member of C<PMC_EXT> is used to store attributes. If your PMC
-will use attributes (not to be confused with ATTRs), your PMC should declare
-C<need_ext>. Note that if code attempts to add an attribute to a PMC which
-doesn't have a C<PMC_EXT>, a C<PMC_EXT> with the appropriate C<_metadata> will
-be added dynamically. In this case, C<need_ext> is a way of telling Parrot to
-take care of this when the PMC is initialized.
-
-=item * The PMC is an aggregate which holds GCable objects.
-
-If the PMC is an aggregate which can contain other GCable object, it needs to
-declare C<need_ext>. GCable objects include other PMCs and Parrot STRINGs.
-Unlike attribute metadata, all PMCs which contain GCable objects need to
-declare C<need_ext>.
-
-=back
-
=head2 ATTRs and C<PMC_data()>
If your PMC needs to store more data than will fit into the 8 bits of the PMC
Modified: branches/pluggable_runcore/docs/pmc2c.pod
==============================================================================
--- branches/pluggable_runcore/docs/pmc2c.pod Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/docs/pmc2c.pod Thu Aug 27 18:38:59 2009 (r40830)
@@ -76,11 +76,6 @@
Classes with this flag get 2 vtables and 2 enums, one pair with
read/write set methods, and one with read-only set methods.
-=item C<need_ext>
-
-The class needs a C<PMC_EXT> structure. For instance, any class using
-C<PMC_data> will have C<need_ext>.
-
=item C<does interface>
The class 'does' the given interfaces (the collection of methods
Modified: branches/pluggable_runcore/editor/README.pod
==============================================================================
--- branches/pluggable_runcore/editor/README.pod Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/editor/README.pod Thu Aug 27 18:38:59 2009 (r40830)
@@ -85,11 +85,19 @@
=head2 TAGS file
There is a script here to automatically generate a TAGS file, which works with
-Vim and other editors that recognize ctags-format files. The tool "exuberant
-ctags" is required. Run
+Vim and other editors that recognize ctags-format files. Run
- make tags
+ make tags-vi
-in the parrot root directory to build the tags file.
+for Vim-compatible tags or
+
+ make tags-emacs
+
+for Emacs-style tags. The tool "exuberant ctags" is required for both. There
+is also the
+
+ make tags-xemacs
+
+target which will work with older XEmacs etags (21.5*).
=cut
Modified: branches/pluggable_runcore/examples/benchmarks/primes.pasm
==============================================================================
--- branches/pluggable_runcore/examples/benchmarks/primes.pasm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/examples/benchmarks/primes.pasm Thu Aug 27 18:38:59 2009 (r40830)
@@ -48,7 +48,7 @@
branch NEXT
OK:
inc P3
- le P3, P4, LOOP
+ lt P3, P4, LOOP
# We haven't found a factor so it must be a prime
inc P6
set P7, P1
Modified: branches/pluggable_runcore/include/parrot/call.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/call.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/call.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -70,10 +70,30 @@
INTVAL slurp_n; /* number of :flat/:slurpy args/params to match */
} call_state_item;
+typedef union UnionCallStateVal {
+ struct _ptrs { /* or two pointers, both are defines */
+ DPOINTER * _struct_val;
+ PMC * _pmc_val;
+ } _ptrs;
+ struct _i {
+ INTVAL _int_val; /* or 2 intvals */
+ INTVAL _int_val2;
+ } _i;
+ FLOATVAL _num_val; /* or one float */
+ struct parrot_string_t * _string_val; /* or a pointer to a string */
+} UnionCallStateVal;
+
+#define UVal_ptr(u) (u)._ptrs._struct_val
+#define UVal_pmc(u) (u)._ptrs._pmc_val
+#define UVal_int(u) (u)._i._int_val
+#define UVal_int2(u) (u)._i._int_val2
+#define UVal_num(u) (u)._num_val
+#define UVal_str(u) (u)._string_val
+
typedef struct call_state {
call_state_item src;
call_state_item dest;
- UnionVal val;
+ UnionCallStateVal val;
int n_actual_args; /* arguments incl. flatten */
int optionals; /* sum of optionals */
int params; /* sum of params */
Modified: branches/pluggable_runcore/include/parrot/gc_api.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/gc_api.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/gc_api.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,12 @@
/* Set to 1 if we want to use the fixed-size allocator. Set to 0 if we want
to allocate these things using mem_sys_allocate instead */
-#define GC_USE_FIXED_SIZE_ALLOCATOR 1
+/* Disabled on Windows platforms until problems get fixed, TT #940 */
+#if defined(_WIN32) || defined(_WIN64)
+# define GC_USE_FIXED_SIZE_ALLOCATOR 0
+#else
+# define GC_USE_FIXED_SIZE_ALLOCATOR 0
+#endif
/*
* we need an alignment that is the same as malloc(3) have for
@@ -176,11 +181,6 @@
int Parrot_gc_active_sized_buffers(PARROT_INTERP)
__attribute__nonnull__(1);
-void Parrot_gc_add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*pmc);
-
void Parrot_gc_add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -236,14 +236,11 @@
void Parrot_gc_destroy_memory_pools(PARROT_INTERP)
__attribute__nonnull__(1);
-UINTVAL Parrot_gc_extended_pmcs(PARROT_INTERP)
- __attribute__nonnull__(1);
-
void Parrot_gc_finalize(PARROT_INTERP)
__attribute__nonnull__(1);
void Parrot_gc_free_bufferlike_header(PARROT_INTERP,
- ARGMOD(PObj *obj),
+ ARGMOD(Buffer *obj),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -263,15 +260,15 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);
-void Parrot_gc_free_pmc_ext(PARROT_INTERP, ARGMOD(PMC *p))
+void Parrot_gc_free_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- FUNC_MODIFIES(*p);
+ FUNC_MODIFIES(*pmc);
-void Parrot_gc_free_pmc_header(PARROT_INTERP, ARGMOD(PMC *pmc))
+void Parrot_gc_free_pmc_sync(PARROT_INTERP, ARGMOD(PMC *p))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
- FUNC_MODIFIES(*pmc);
+ FUNC_MODIFIES(*p);
void Parrot_gc_free_string_header(PARROT_INTERP, ARGMOD(STRING *s))
__attribute__nonnull__(1)
@@ -380,9 +377,6 @@
#define ASSERT_ARGS_Parrot_gc_active_sized_buffers \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_add_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(pmc)
#define ASSERT_ARGS_Parrot_gc_add_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
@@ -420,8 +414,6 @@
#define ASSERT_ARGS_Parrot_gc_destroy_memory_pools \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_extended_pmcs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_finalize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_gc_free_bufferlike_header \
@@ -435,12 +427,12 @@
#define ASSERT_ARGS_Parrot_gc_free_pmc_attributes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
-#define ASSERT_ARGS_Parrot_gc_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(p)
#define ASSERT_ARGS_Parrot_gc_free_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
+#define ASSERT_ARGS_Parrot_gc_free_pmc_sync __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(p)
#define ASSERT_ARGS_Parrot_gc_free_string_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(s)
Modified: branches/pluggable_runcore/include/parrot/hash.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/hash.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/hash.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -28,11 +28,12 @@
/*
* hash_entry is currently unused in the hash structure
- */
+
typedef struct _hash_entry {
HashEntryType type;
UnionVal val;
} HashEntry;
+*/
/* A BucketIndex is an index into the pool of available buckets. */
typedef UINTVAL BucketIndex;
@@ -42,7 +43,7 @@
#define HASH_ALLOC_SIZE(n) (N_BUCKETS(n) * sizeof (HashBucket) + \
(n) * sizeof (HashBucket *))
-typedef int (*hash_comp_fn)(PARROT_INTERP, const void*const, const void*const);
+typedef int (*hash_comp_fn)(PARROT_INTERP, const void *const, const void *const);
typedef void (*hash_mark_key_fn)(PARROT_INTERP, PObj *);
typedef size_t (*hash_hash_key_fn)(PARROT_INTERP, ARGIN(const void *), size_t seed);
Modified: branches/pluggable_runcore/include/parrot/list.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/list.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/list.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -15,7 +15,7 @@
#define PARROT_LIST_H_GUARD
typedef struct List_chunk {
- Buffer data; /* item store */
+ Buffer data; /* item store, Buffer must be first element in struct*/
struct List_chunk *next;
struct List_chunk *prev;
UINTVAL flags; /* chunk flags */
Modified: branches/pluggable_runcore/include/parrot/pmc.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/pmc.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/pmc.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -54,6 +54,11 @@
__attribute__nonnull__(1);
PARROT_EXPORT
+void Parrot_pmc_destroy(PARROT_INTERP, ARGIN(PMC *pmc))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_EXPORT
INTVAL PMC_is_null(SHIM_INTERP, ARGIN_NULLOK(const PMC *pmc));
PARROT_EXPORT
@@ -149,6 +154,9 @@
|| PARROT_ASSERT_ARG(pmc)
#define ASSERT_ARGS_Parrot_create_mro __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_pmc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(pmc)
#define ASSERT_ARGS_PMC_is_null __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
#define ASSERT_ARGS_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
Modified: branches/pluggable_runcore/include/parrot/pobj.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/pobj.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/pobj.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -15,46 +15,19 @@
#include "parrot/config.h"
-typedef union UnionVal {
- struct _b { /* One Buffer structure */
- void * _bufstart;
- size_t _buflen;
- } _b;
- struct _ptrs { /* or two pointers, both are defines */
- DPOINTER * _struct_val;
- PMC * _pmc_val;
- } _ptrs;
- struct _i {
- INTVAL _int_val; /* or 2 intvals */
- INTVAL _int_val2;
- } _i;
- FLOATVAL _num_val; /* or one float */
- struct parrot_string_t * _string_val; /* or a pointer to a string */
-} UnionVal;
-
-#define UVal_ptr(u) (u)._ptrs._struct_val
-#define UVal_pmc(u) (u)._ptrs._pmc_val
-#define UVal_int(u) (u)._i._int_val
-#define UVal_int2(u) (u)._i._int_val2
-#define UVal_num(u) (u)._num_val
-#define UVal_str(u) (u)._string_val
-
/* Parrot Object - base class for all others */
typedef struct pobj_t {
- UnionVal u;
Parrot_UInt flags;
-} pobj_t;
+} PObj;
-/* plain Buffer is the smallest Parrot Obj */
-typedef struct Buffer {
- UnionVal cache;
+typedef struct buffer_t {
Parrot_UInt flags;
+ void * _bufstart;
+ size_t _buflen;
} Buffer;
-typedef Buffer PObj;
-
-#define PObj_bufstart(pmc) (pmc)->cache._b._bufstart
-#define PObj_buflen(pmc) (pmc)->cache._b._buflen
+#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:
@@ -84,24 +57,20 @@
v v v v
*/
-typedef struct Buffer_alloc_unit {
- INTVAL ref_count;
- UnionVal buffer[1]; /* Guarantee it's suitably aligned */
-} Buffer_alloc_unit;
/* 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. */
#ifdef GC_IS_MALLOC /* see src/gc/res_lea.c */
# define Buffer_alloc_offset (offsetof(Buffer_alloc_unit, buffer))
-# define PObj_bufallocstart(b) ((char *)PObj_bufstart(b) - Buffer_alloc_offset)
-# define PObj_bufrefcount(b) (((Buffer_alloc_unit *)PObj_bufallocstart(b))->ref_count)
-# define PObj_bufrefcountptr(b) (&PObj_bufrefcount(b))
+# define Buffer_bufallocstart(b) ((char *)Buffer_bufstart(b) - Buffer_alloc_offset)
+# define Buffer_bufrefcount(b) (((Buffer_alloc_unit *)Buffer_bufallocstart(b))->ref_count)
+# define Buffer_bufrefcountptr(b) (&Buffer_bufrefcount(b))
#else /* see src/gc/alloc_resources.c */
# define Buffer_alloc_offset sizeof (INTVAL)
-# define PObj_bufallocstart(b) ((char *)PObj_bufstart(b) - Buffer_alloc_offset)
-# define PObj_bufrefcount(b) (*(INTVAL *)PObj_bufallocstart(b))
-# define PObj_bufrefcountptr(b) ((INTVAL *)PObj_bufallocstart(b))
+# define Buffer_bufallocstart(b) ((char *)Buffer_bufstart(b) - Buffer_alloc_offset)
+# define Buffer_bufrefcount(b) (*(INTVAL *)Buffer_bufallocstart(b))
+# define Buffer_bufrefcountptr(b) ((INTVAL *)Buffer_bufallocstart(b))
#endif
typedef enum {
@@ -112,8 +81,9 @@
} parrot_string_representation_t;
struct parrot_string_t {
- UnionVal cache;
Parrot_UInt flags;
+ void * _bufstart;
+ size_t _buflen;
char *strstart;
UINTVAL bufused;
UINTVAL strlen;
@@ -124,18 +94,14 @@
const struct _charset *charset;
};
+struct _Sync; /* forward decl */
+
/* note that cache and flags are isomorphic with Buffer and PObj */
struct PMC {
- UnionVal cache;
Parrot_UInt flags;
VTABLE *vtable;
DPOINTER *data;
- struct PMC_EXT *pmc_ext;
-};
-struct _Sync; /* forward decl */
-
-typedef struct PMC_EXT {
PMC *_metadata; /* properties */
/*
* PMC access synchronization for shared PMCs
@@ -160,21 +126,16 @@
stuff, which'd merit an extra dereference when setting, but let
us memset the actual GC data in a big block
*/
-} PMC_EXT;
+};
-#ifdef NDEBUG
-# define PMC_ext_checked(pmc) (pmc)->pmc_ext
-#else
-# define PMC_ext_checked(pmc) (PARROT_ASSERT((pmc)->pmc_ext), (pmc)->pmc_ext)
-#endif /* NDEBUG */
#define PMC_data(pmc) (pmc)->data
#define PMC_data_typed(pmc, type) (type)(pmc)->data
/* do not allow PMC_data2 as lvalue */
#define PMC_data0(pmc) (1 ? (pmc)->data : 0)
#define PMC_data0_typed(pmc) (type)(1 ? (pmc)->data : 0)
-#define PMC_metadata(pmc) PMC_ext_checked(pmc)->_metadata
-#define PMC_next_for_GC(pmc) PMC_ext_checked(pmc)->_next_for_GC
-#define PMC_sync(pmc) PMC_ext_checked(pmc)->_synchronize
+#define PMC_metadata(pmc) ((pmc)->_metadata)
+#define PMC_next_for_GC(pmc) ((pmc)->_next_for_GC)
+#define PMC_sync(pmc) ((pmc)->_synchronize)
#define POBJ_FLAG(n) ((UINTVAL)1 << (n))
/* PObj flags */
@@ -199,8 +160,6 @@
PObj_is_string_FLAG = POBJ_FLAG(8),
/* PObj is a PMC */
PObj_is_PMC_FLAG = POBJ_FLAG(9),
- /* the PMC has a PMC_EXT structure appended */
- PObj_is_PMC_EXT_FLAG = POBJ_FLAG(10),
/* the PMC is a shared PMC */
PObj_is_PMC_shared_FLAG = POBJ_FLAG(11), /* Same as PObj_is_shared_FLAG */
/* PObj is otherwise shared */
@@ -333,7 +292,6 @@
if ((PObj_get_FLAGS(o) & \
(PObj_active_destroy_FLAG | \
PObj_custom_mark_FLAG | \
- PObj_is_PMC_EXT_FLAG | \
PObj_needs_early_gc_FLAG))) \
gc_flag_SET(is_special_PMC, o); \
else \
@@ -369,9 +327,6 @@
#define PObj_is_PMC_TEST(o) PObj_flag_TEST(is_PMC, o)
-#define PObj_is_PMC_EXT_TEST(o) PObj_flag_TEST(is_PMC_EXT, o)
-#define PObj_is_PMC_EXT_SET(o) PObj_special_SET(is_PMC_EXT, o)
-
#define PObj_is_PMC_shared_TEST(o) PObj_flag_TEST(is_PMC_shared, o)
#define PObj_is_PMC_shared_SET(o) PObj_flag_SET(is_PMC_shared, o)
#define PObj_is_PMC_shared_CLEAR(o) PObj_flag_CLEAR(is_PMC_shared, o)
Modified: branches/pluggable_runcore/include/parrot/sub.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/sub.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/sub.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -150,6 +150,8 @@
} \
} while (0)
+typedef struct Parrot_Sub_attributes Parrot_sub;
+typedef struct Parrot_Coroutine_attributes Parrot_coro;
typedef struct Parrot_cont {
/* continuation destination */
Modified: branches/pluggable_runcore/include/parrot/vtables.h
==============================================================================
--- branches/pluggable_runcore/include/parrot/vtables.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/include/parrot/vtables.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -32,6 +32,10 @@
FUNC_MODIFIES(*vtable);
PARROT_EXPORT
+void Parrot_initialize_core_vtables(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
+PARROT_EXPORT
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
VTABLE * Parrot_new_vtable(SHIM_INTERP);
@@ -54,6 +58,9 @@
#define ASSERT_ARGS_Parrot_destroy_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(vtable)
+#define ASSERT_ARGS_Parrot_initialize_core_vtables \
+ __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_new_vtable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
#define ASSERT_ARGS_mark_vtables __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
Modified: branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/lib/Parrot/Pmc2c/PMCEmitter.pm Thu Aug 27 18:38:59 2009 (r40830)
@@ -421,7 +421,6 @@
my ($self) = @_;
my $vtbl_flag = 0;
- $vtbl_flag .= '|VTABLE_PMC_NEEDS_EXT' if $self->flag('need_ext');
$vtbl_flag .= '|VTABLE_PMC_IS_SINGLETON' if $self->flag('singleton');
$vtbl_flag .= '|VTABLE_IS_SHARED_FLAG' if $self->flag('is_shared');
$vtbl_flag .= '|VTABLE_IS_READONLY_FLAG' if $self->flag('is_ro');
@@ -1113,7 +1112,7 @@
elsif ($letter eq 'P') {
return (
'PPP->P',
- 'PMC *retval;',
+ 'PMC *retval = PMCNULL;',
", &retval",
"return retval;",
);
Modified: branches/pluggable_runcore/src/call/pcc.c
==============================================================================
--- branches/pluggable_runcore/src/call/pcc.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/call/pcc.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -1666,7 +1666,7 @@
* RT #54860 and others
* Save current value while setting the optional
*/
- const UnionVal old_value = st->val;
+ const UnionCallStateVal old_value = st->val;
while (dest->sig & PARROT_ARG_OPTIONAL) {
null_val(st->dest.sig, st);
Modified: branches/pluggable_runcore/src/debug.c
==============================================================================
--- branches/pluggable_runcore/src/debug.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/debug.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -3373,12 +3373,12 @@
if (!s)
return;
- Parrot_io_eprintf(interp, "\tBuflen =\t%12ld\n", PObj_buflen(s));
+ Parrot_io_eprintf(interp, "\tBuflen =\t%12ld\n", Buffer_buflen(s));
Parrot_io_eprintf(interp, "\tFlags =\t%12ld\n", PObj_get_FLAGS(s));
Parrot_io_eprintf(interp, "\tBufused =\t%12ld\n", s->bufused);
Parrot_io_eprintf(interp, "\tStrlen =\t%12ld\n", s->strlen);
Parrot_io_eprintf(interp, "\tOffset =\t%12ld\n",
- (char*) s->strstart - (char*) PObj_bufstart(s));
+ (char*) s->strstart - (char*) Buffer_bufstart(s));
Parrot_io_eprintf(interp, "\tString =\t%S\n", s);
}
Modified: branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc
==============================================================================
--- branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/dynpmc/dynlexpad.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,7 @@
*/
-pmclass DynLexPad dynpmc provides lexpad need_ext auto_attrs {
+pmclass DynLexPad dynpmc provides lexpad auto_attrs {
ATTR Hash *hash;
ATTR PMC *init; /* the PMC used to initialize this DynLexPad */
Modified: branches/pluggable_runcore/src/dynpmc/subproxy.pmc
==============================================================================
--- branches/pluggable_runcore/src/dynpmc/subproxy.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/dynpmc/subproxy.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2003-2008, Parrot Foundation.
+ * Copyright (C) 2003-2009, Parrot Foundation.
*/
/*
@@ -14,7 +14,7 @@
*/
#define enum_class_SubProxy -1
-pmclass SubProxy dynpmc need_ext extends Sub {
+pmclass SubProxy dynpmc extends Sub auto_attrs {
VTABLE void init() {
SUPER();
Modified: branches/pluggable_runcore/src/gc/alloc_resources.c
==============================================================================
--- branches/pluggable_runcore/src/gc/alloc_resources.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/alloc_resources.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -54,7 +54,18 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-static void debug_print_buf(PARROT_INTERP, ARGIN(const PObj *b))
+static void check_memory_pool(ARGMOD(Memory_Pool *pool))
+ __attribute__nonnull__(1)
+ FUNC_MODIFIES(*pool);
+
+static void check_memory_system(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
+static void check_small_object_pool(ARGMOD(Small_Object_Pool * pool))
+ __attribute__nonnull__(1)
+ FUNC_MODIFIES(* pool);
+
+static void debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -71,6 +82,12 @@
#define ASSERT_ARGS_buffer_location __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(b)
+#define ASSERT_ARGS_check_memory_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(pool)
+#define ASSERT_ARGS_check_memory_system __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_check_small_object_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_debug_print_buf __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(b)
@@ -277,7 +294,7 @@
/*
-=item C<static void debug_print_buf(PARROT_INTERP, const PObj *b)>
+=item C<static void debug_print_buf(PARROT_INTERP, const Buffer *b)>
Prints a debug statement with information about the given PObj C<b>.
=cut
@@ -285,11 +302,11 @@
*/
static void
-debug_print_buf(PARROT_INTERP, ARGIN(const PObj *b))
+debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b))
{
ASSERT_ARGS(debug_print_buf)
fprintf(stderr, "found %p, len %d, flags 0x%08x at %s\n",
- b, (int)PObj_buflen(b), (uint)PObj_get_FLAGS(b),
+ b, (int)Buffer_buflen(b), (uint)PObj_get_FLAGS(b),
buffer_location(interp, b));
}
#endif
@@ -405,21 +422,21 @@
INTVAL *ref_count = NULL;
/* ! (on_free_list | constant | external | sysmem) */
- if (PObj_buflen(b) && PObj_is_movable_TESTALL(b)) {
+ if (Buffer_buflen(b) && PObj_is_movable_TESTALL(b)) {
ptrdiff_t offset = 0;
#if RESOURCE_DEBUG
- if (PObj_buflen(b) >= RESOURCE_DEBUG_SIZE)
+ if (Buffer_buflen(b) >= RESOURCE_DEBUG_SIZE)
debug_print_buf(interp, b);
#endif
/* we can't perform the math all the time, because
* strstart might be in unallocated memory */
if (PObj_is_COWable_TEST(b)) {
- ref_count = PObj_bufrefcountptr(b);
+ ref_count = Buffer_bufrefcountptr(b);
if (PObj_is_string_TEST(b)) {
offset = (ptrdiff_t)((STRING *)b)->strstart -
- (ptrdiff_t)PObj_bufstart(b);
+ (ptrdiff_t)Buffer_bufstart(b);
}
}
@@ -427,7 +444,8 @@
if (PObj_COW_TEST(b) &&
(ref_count && *ref_count & Buffer_moved_FLAG)) {
/* Find out who else references our data */
- Buffer * const hdr = *(Buffer **)(PObj_bufstart(b));
+ Buffer * const hdr = *((Buffer **)Buffer_bufstart(b));
+
PARROT_ASSERT(PObj_is_COWable_TEST(b));
@@ -436,13 +454,13 @@
/* TODO incr ref_count, after fixing string too
* Now make sure we point to where the other guy does */
- PObj_bufstart(b) = PObj_bufstart(hdr);
+ Buffer_bufstart(b) = Buffer_bufstart(hdr);
/* And if we're a string, update strstart */
/* Somewhat of a hack, but if we get per-pool
* collections, it should help ease the pain */
if (PObj_is_string_TEST(b)) {
- ((STRING *)b)->strstart = (char *)PObj_bufstart(b) +
+ ((STRING *)b)->strstart = (char *)Buffer_bufstart(b) +
offset;
}
}
@@ -455,14 +473,14 @@
}
/* Copy our memory to the new pool */
- memcpy(cur_spot, PObj_bufstart(b), PObj_buflen(b));
+ memcpy(cur_spot, Buffer_bufstart(b), Buffer_buflen(b));
/* If we're COW */
if (PObj_COW_TEST(b)) {
PARROT_ASSERT(PObj_is_COWable_TEST(b));
/* Let the old buffer know how to find us */
- *(Buffer **)(PObj_bufstart(b)) = b;
+ *((Buffer **)Buffer_bufstart(b)) = b;
/* No guarantees that our data is still COW, so
* assume not, and let the above code fix-up */
@@ -475,14 +493,14 @@
*ref_count |= Buffer_moved_FLAG;
}
- PObj_bufstart(b) = cur_spot;
+ Buffer_bufstart(b) = cur_spot;
if (PObj_is_string_TEST(b)) {
- ((STRING *)b)->strstart = (char *)PObj_bufstart(b) +
+ ((STRING *)b)->strstart = (char *)Buffer_bufstart(b) +
offset;
}
- cur_spot += PObj_buflen(b);
+ cur_spot += Buffer_buflen(b);
}
}
b = (Buffer *)((char *)b + object_size);
@@ -671,7 +689,6 @@
/* Constant strings - not compacted */
arena_base->constant_string_pool = new_memory_pool(POOL_SIZE, NULL);
-
alloc_new_block(interp, POOL_SIZE, arena_base->constant_string_pool, "init");
}
@@ -699,9 +716,8 @@
while (cur_block) {
Memory_Block * const next_block = cur_block->prev;
- if (cur_block->free == cur_block->size) {
+ if (cur_block->free == cur_block->size)
mem_internal_free(cur_block);
- }
else {
cur_block->next = NULL;
cur_block->prev = dest->top_block;
@@ -723,6 +739,205 @@
/*
+=item C<static void check_memory_system(PARROT_INTERP)>
+
+Checks the memory system of parrot on any corruptions, including
+the string system.
+
+=cut
+
+*/
+
+static void
+check_memory_system(PARROT_INTERP)
+{
+ ASSERT_ARGS(check_memory_system)
+ size_t i;
+ Arenas * const arena_base = interp->arena_base;
+
+ check_memory_pool(arena_base->memory_pool);
+ check_memory_pool(arena_base->constant_string_pool);
+ check_small_object_pool(arena_base->pmc_pool);
+ check_small_object_pool(arena_base->constant_pmc_pool);
+ check_small_object_pool(arena_base->string_header_pool);
+ check_small_object_pool(arena_base->constant_string_header_pool);
+
+ for (i = 0; i < arena_base->num_sized; i++) {
+ Small_Object_Pool * pool = arena_base->sized_header_pools[i];
+ if (pool != NULL && pool != arena_base->string_header_pool)
+ check_small_object_pool(pool);
+ }
+}
+
+/*
+
+=item C<static void check_small_object_pool(Small_Object_Pool * pool)>
+
+Checks a small object pool, if it contains buffer it checks the buffers also.
+
+=cut
+
+*/
+
+static void
+check_small_object_pool(ARGMOD(Small_Object_Pool * pool))
+{
+ ASSERT_ARGS(check_small_object_pool)
+ size_t total_objects;
+ size_t last_free_list_count;
+ Small_Object_Arena * arena_walker;
+ size_t free_objects;
+ PObj * object;
+ size_t i;
+ size_t count;
+ GC_MS_PObj_Wrapper * pobj_walker;
+
+ count = 10000000; /*detect unendless loop just use big enough number*/
+
+ total_objects = pool->total_objects;
+ last_free_list_count = 1;
+ free_objects = 0;
+
+ arena_walker = pool->last_Arena;
+ while (arena_walker != NULL) {
+ total_objects -= arena_walker->total_objects;
+ object = (PObj*)arena_walker->start_objects;
+ for (i = 0; i < arena_walker->total_objects; ++i) {
+ if (PObj_on_free_list_TEST(object)) {
+ ++free_objects;
+ pobj_walker = (GC_MS_PObj_Wrapper*)object;
+ if (pobj_walker->next_ptr == NULL)
+ /* should happen only once at the end */
+ --last_free_list_count;
+ else {
+ /* next item on free list should also be flaged as free item */
+ pobj_walker = (GC_MS_PObj_Wrapper*)pobj_walker->next_ptr;
+ PARROT_ASSERT(PObj_on_free_list_TEST((PObj*)pobj_walker));
+ }
+ }
+ else if (pool->mem_pool != NULL) {
+ /*then it means we are a buffer*/
+ check_buffer_ptr((Buffer*)object, pool->mem_pool);
+ }
+ object = (PObj*)((char *)object + pool->object_size);
+ PARROT_ASSERT(--count);
+ }
+ /*check the list*/
+ if (arena_walker->prev != NULL)
+ PARROT_ASSERT(arena_walker->prev->next == arena_walker);
+ arena_walker = arena_walker->prev;
+ PARROT_ASSERT(--count);
+ }
+
+ count = 10000000;
+
+ PARROT_ASSERT(free_objects == pool->num_free_objects);
+
+ pobj_walker = (GC_MS_PObj_Wrapper*)pool->free_list;
+ while (pobj_walker != NULL) {
+ PARROT_ASSERT(pool->start_arena_memory <= (size_t)pobj_walker);
+ PARROT_ASSERT(pool->end_arena_memory > (size_t)pobj_walker);
+ PARROT_ASSERT(PObj_on_free_list_TEST((PObj*)pobj_walker));
+ --free_objects;
+ pobj_walker = (GC_MS_PObj_Wrapper*)pobj_walker->next_ptr;
+ PARROT_ASSERT(--count);
+ }
+
+ PARROT_ASSERT(total_objects == 0);
+ PARROT_ASSERT(last_free_list_count == 0 || pool->num_free_objects == 0);
+ PARROT_ASSERT(free_objects == 0);
+}
+
+/*
+
+=item C<static void check_memory_pool(Memory_Pool *pool)>
+
+Checks a memory pool, containing buffer data
+
+=cut
+
+*/
+
+static void
+check_memory_pool(ARGMOD(Memory_Pool *pool))
+{
+ ASSERT_ARGS(check_memory_pool)
+ size_t count;
+ Memory_Block * block_walker;
+ count = 10000000; /*detect unendless loop just use big enough number*/
+
+ block_walker = (Memory_Block *)pool->top_block;
+ while (block_walker != NULL) {
+ PARROT_ASSERT(block_walker->start == (char *)block_walker +
+ sizeof (Memory_Block));
+ PARROT_ASSERT((size_t)(block_walker->top -
+ block_walker->start) == block_walker->size - block_walker->free);
+
+ /*check the list*/
+ if (block_walker->prev != NULL)
+ PARROT_ASSERT(block_walker->prev->next == block_walker);
+ block_walker = block_walker->prev;
+ PARROT_ASSERT(--count);
+ }
+}
+
+/*
+
+=item C<void check_buffer_ptr(Buffer * pobj, Memory_Pool * pool)>
+
+Checks wether the buffer is within the bounds of the memory pool
+
+=cut
+
+*/
+
+void
+check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Memory_Pool * pool))
+{
+ ASSERT_ARGS(check_buffer_ptr)
+ Memory_Block * cur_block = pool->top_block;
+ char * bufstart;
+
+ bufstart = (char*)Buffer_bufstart(pobj);
+
+ if (bufstart == NULL && Buffer_buflen(pobj) == 0)
+ return;
+
+ if (PObj_external_TEST(pobj) || PObj_sysmem_TEST(pobj)) {
+ /*buffer does not come from the memory pool*/
+ if (PObj_is_string_TEST(pobj)) {
+ PARROT_ASSERT(((STRING *) pobj)->strstart >=
+ (char *) Buffer_bufstart(pobj));
+ PARROT_ASSERT(((STRING *) pobj)->strstart +
+ ((STRING *) pobj)->strlen <=
+ (char *) Buffer_bufstart(pobj) + Buffer_buflen(pobj));
+ }
+ return;
+ }
+
+ if (PObj_is_COWable_TEST(pobj))
+ bufstart -= sizeof (void*);
+
+ while (cur_block) {
+ if ((char *)bufstart >= cur_block->start &&
+ (char *)Buffer_bufstart(pobj) +
+ Buffer_buflen(pobj) < cur_block->start + cur_block->size) {
+ if (PObj_is_string_TEST(pobj)) {
+ PARROT_ASSERT(((STRING *)pobj)->strstart >=
+ (char *)Buffer_bufstart(pobj));
+ PARROT_ASSERT(((STRING *)pobj)->strstart +
+ ((STRING *)pobj)->strlen <= (char *)Buffer_bufstart(pobj) +
+ Buffer_buflen(pobj));
+ }
+ return;
+ }
+ cur_block = cur_block->prev;
+ }
+ PARROT_ASSERT(0);
+}
+
+/*
+
=back
=head1 SEE ALSO
Modified: branches/pluggable_runcore/src/gc/api.c
==============================================================================
--- branches/pluggable_runcore/src/gc/api.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/api.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -229,17 +229,14 @@
if (PObj_is_special_PMC_TEST(obj))
mark_special(interp, p);
-# ifndef NDEBUG
- else if (p->pmc_ext && PMC_metadata(p))
- fprintf(stderr, "GC: error obj %p (%s) has properties\n",
- (void *)p, (char*)p->vtable->whoami->strstart);
-# endif
+ else if (PMC_metadata(p))
+ Parrot_gc_mark_PObj_alive(interp, (PObj*)PMC_metadata(p));
}
# if GC_VERBOSE
/* buffer GC_DEBUG stuff */
if (GC_DEBUG(interp) && PObj_report_TEST(obj))
fprintf(stderr, "GC: buffer %p pointing to %p marked live\n",
- obj, PObj_bufstart((Buffer *)obj));
+ obj, Buffer_bufstart((Buffer *)obj));
# endif
#endif /* PARROT_GC_GMS */
}
@@ -335,17 +332,10 @@
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
"Parrot VM: PMC allocation failed!\n");
- /* clear flags, set is_PMC_FLAG */
- if (flags & PObj_is_PMC_EXT_FLAG) {
- Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
- flags |= PObj_is_special_PMC_FLAG;
- pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool);
+ flags |= PObj_is_special_PMC_FLAG;
- if (flags & PObj_is_PMC_shared_FLAG)
- Parrot_gc_add_pmc_sync(interp, pmc);
- }
- else
- pmc->pmc_ext = NULL;
+ if (flags & PObj_is_PMC_shared_FLAG)
+ Parrot_gc_add_pmc_sync(interp, pmc);
PObj_get_FLAGS(pmc) = PObj_is_PMC_FLAG|flags;
pmc->vtable = NULL;
@@ -374,18 +364,17 @@
if (PObj_active_destroy_TEST(pmc))
VTABLE_destroy(interp, pmc);
+ Parrot_gc_free_pmc_sync(interp, pmc);
if (PMC_data(pmc) && pmc->vtable->attr_size) {
-#if 0
+#if GC_USE_FIXED_SIZE_ALLOCATOR
+ Parrot_gc_free_pmc_attributes(interp, pmc, pmc->vtable->attr_size);
+#else
mem_sys_free(PMC_data(pmc));
PMC_data(pmc) = NULL;
-#else
- Parrot_gc_free_pmc_attributes(interp, pmc, pmc->vtable->attr_size);
#endif
}
PARROT_ASSERT(NULL == PMC_data(pmc));
- if (PObj_is_PMC_EXT_TEST(pmc))
- Parrot_gc_free_pmc_ext(interp, pmc);
PObj_flags_SETTO((PObj *)pmc, PObj_on_free_list_FLAG);
pool->add_free_object(interp, pool, (PObj *)pmc);
@@ -394,71 +383,24 @@
/*
-=item C<void Parrot_gc_add_pmc_ext(PARROT_INTERP, PMC *pmc)>
-
-Obtains a new C<PMC_EXT> structure, and attaches it to the given C<PMC>.
-Sets the necessary flags associated with the PMC_EXT structure. Ensures
-that the PMC_EXT structure is marked as "alive" by the GC.
-
-=cut
-
-*/
-
-void
-Parrot_gc_add_pmc_ext(PARROT_INTERP, ARGMOD(PMC *pmc))
-{
- ASSERT_ARGS(Parrot_gc_add_pmc_ext)
- Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
- if (!pmc->pmc_ext)
- pmc->pmc_ext = (PMC_EXT *)pool->get_free_object(interp, pool);
- if (!pmc->pmc_ext)
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ALLOCATION_ERROR,
- "Parrot VM: PMC_EXT allocation failed!\n");
- PObj_is_PMC_EXT_SET(pmc);
- PObj_is_special_PMC_SET(pmc);
-
-#ifdef PARROT_GC_IMS
- /*
- * preserve DDD color: a simple PMC live = black
- * an aggregate live = grey
- * set'em black
- */
- if (PObj_live_TEST(pmc))
- PObj_get_FLAGS(pmc) |= PObj_custom_GC_FLAG;
-#endif
-
- PMC_next_for_GC(pmc) = PMCNULL;
-}
-
-/*
-
-=item C<void Parrot_gc_free_pmc_ext(PARROT_INTERP, PMC *p)>
+=item C<void Parrot_gc_free_pmc_sync(PARROT_INTERP, PMC *p)>
-Frees the C<PMC_EXT> structure attached to a PMC, if it exists.
+Frees the PMC_sync field of the PMC, if one exists.
=cut
*/
void
-Parrot_gc_free_pmc_ext(PARROT_INTERP, ARGMOD(PMC *p))
+Parrot_gc_free_pmc_sync(PARROT_INTERP, ARGMOD(PMC *p))
{
- ASSERT_ARGS(Parrot_gc_free_pmc_ext)
- /* if the PMC has a PMC_EXT structure, return it to the pool/arena */
- Arenas * const arena_base = interp->arena_base;
- Small_Object_Pool * const ext_pool = arena_base->pmc_ext_pool;
-
- if (!p->pmc_ext)
- return;
+ ASSERT_ARGS(Parrot_gc_free_pmc_sync)
if (PObj_is_PMC_shared_TEST(p) && PMC_sync(p)) {
MUTEX_DESTROY(PMC_sync(p)->pmc_lock);
mem_internal_free(PMC_sync(p));
PMC_sync(p) = NULL;
}
- ext_pool->add_free_object(interp, ext_pool, p->pmc_ext);
- ext_pool->num_free_objects++;
- p->pmc_ext = NULL;
}
/*
@@ -477,8 +419,6 @@
Parrot_gc_add_pmc_sync(PARROT_INTERP, ARGMOD(PMC *pmc))
{
ASSERT_ARGS(Parrot_gc_add_pmc_sync)
- if (!PObj_is_PMC_EXT_TEST(pmc))
- Parrot_gc_add_pmc_ext(interp, pmc);
if (PMC_sync(pmc))
/* This mutex already exists, leave it alone. */
return;
@@ -510,6 +450,7 @@
Parrot_gc_new_string_header(PARROT_INTERP, UINTVAL flags)
{
ASSERT_ARGS(Parrot_gc_new_string_header)
+
STRING * const string = (STRING *)get_free_buffer(interp,
(flags & PObj_constant_FLAG)
? interp->arena_base->constant_string_header_pool
@@ -564,6 +505,7 @@
Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)
{
ASSERT_ARGS(Parrot_gc_new_bufferlike_header)
+
Small_Object_Pool * const pool = get_bufferlike_pool(interp, size);
return get_free_buffer(interp, pool);
@@ -587,22 +529,22 @@
get_free_buffer(PARROT_INTERP, ARGIN(Small_Object_Pool *pool))
{
ASSERT_ARGS(get_free_buffer)
- PObj * const buffer = (PObj *)pool->get_free_object(interp, pool);
+ Buffer * const buffer = (Buffer *)pool->get_free_object(interp, pool);
/* don't mess around with flags */
- PObj_bufstart(buffer) = NULL;
- PObj_buflen(buffer) = 0;
+ Buffer_bufstart(buffer) = NULL;
+ Buffer_buflen(buffer) = 0;
- if (pool->object_size - GC_HEADER_SIZE > sizeof (PObj))
+ if (pool->object_size - GC_HEADER_SIZE > sizeof (Buffer))
memset(buffer + 1, 0,
- pool->object_size - sizeof (PObj) - GC_HEADER_SIZE);
+ pool->object_size - sizeof (Buffer) - GC_HEADER_SIZE);
return buffer;
}
/*
-=item C<void Parrot_gc_free_bufferlike_header(PARROT_INTERP, PObj *obj, size_t
+=item C<void Parrot_gc_free_bufferlike_header(PARROT_INTERP, Buffer *obj, size_t
size)>
Free a bufferlike header that is not being used, so that Parrot can recycle
@@ -613,7 +555,7 @@
*/
void
-Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(PObj *obj),
+Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj),
size_t size)
{
ASSERT_ARGS(Parrot_gc_free_bufferlike_header)
@@ -642,16 +584,16 @@
size_t new_size;
char *mem;
- PObj_buflen(buffer) = 0;
- PObj_bufstart(buffer) = NULL;
+ Buffer_buflen(buffer) = 0;
+ Buffer_bufstart(buffer) = NULL;
new_size = aligned_size(buffer, size);
mem = (char *)mem_allocate(interp, new_size,
interp->arena_base->memory_pool);
mem = aligned_mem(buffer, mem);
- PObj_bufstart(buffer) = mem;
+ Buffer_bufstart(buffer) = mem;
if (PObj_is_COWable_TEST(buffer))
new_size -= sizeof (void*);
- PObj_buflen(buffer) = new_size;
+ Buffer_buflen(buffer) = new_size;
}
/*
@@ -682,7 +624,7 @@
/*
* we don't shrink buffers
*/
- if (newsize <= PObj_buflen(buffer))
+ if (newsize <= Buffer_buflen(buffer))
return;
/*
@@ -694,18 +636,18 @@
* The normal case is therefore always to allocate a new block
*/
new_size = aligned_size(buffer, newsize);
- old_size = aligned_size(buffer, PObj_buflen(buffer));
+ old_size = aligned_size(buffer, Buffer_buflen(buffer));
needed = new_size - old_size;
if ((pool->top_block->free >= needed)
- && (pool->top_block->top == (char *)PObj_bufstart(buffer) + old_size)) {
+ && (pool->top_block->top == (char *)Buffer_bufstart(buffer) + old_size)) {
pool->top_block->free -= needed;
pool->top_block->top += needed;
- PObj_buflen(buffer) = newsize;
+ Buffer_buflen(buffer) = newsize;
return;
}
- copysize = PObj_buflen(buffer);
+ copysize = Buffer_buflen(buffer);
if (!PObj_COW_TEST(buffer))
pool->guaranteed_reclaimable += copysize;
@@ -717,14 +659,14 @@
/* We shouldn't ever have a 0 from size, but we do. If we can track down
* those bugs, this can be removed which would make things cheaper */
if (copysize)
- memcpy(mem, PObj_bufstart(buffer), copysize);
+ memcpy(mem, Buffer_bufstart(buffer), copysize);
- PObj_bufstart(buffer) = mem;
+ Buffer_bufstart(buffer) = mem;
if (PObj_is_COWable_TEST(buffer))
new_size -= sizeof (void *);
- PObj_buflen(buffer) = new_size;
+ Buffer_buflen(buffer) = new_size;
}
/*
@@ -750,8 +692,8 @@
Memory_Pool *pool;
char *mem;
- PObj_buflen(str) = 0;
- PObj_bufstart(str) = NULL;
+ Buffer_buflen(str) = 0;
+ Buffer_bufstart(str) = NULL;
/* there's no sense in allocating zero memory, when the overhead of
* allocating a string is one pointer; this can fill the pools in an
@@ -768,8 +710,8 @@
mem = (char *)mem_allocate(interp, new_size, pool);
mem += sizeof (void*);
- PObj_bufstart(str) = str->strstart = mem;
- PObj_buflen(str) = new_size - sizeof (void*);
+ Buffer_bufstart(str) = str->strstart = mem;
+ Buffer_buflen(str) = new_size - sizeof (void*);
}
/*
@@ -800,7 +742,7 @@
: interp->arena_base->memory_pool;
/* if the requested size is smaller then buflen, we are done */
- if (newsize <= PObj_buflen(str))
+ if (newsize <= Buffer_buflen(str))
return;
/*
@@ -809,14 +751,14 @@
* - if there is enough size, we can just move the pool's top pointer
*/
new_size = aligned_string_size(newsize);
- old_size = aligned_string_size(PObj_buflen(str));
+ old_size = aligned_string_size(Buffer_buflen(str));
needed = new_size - old_size;
if (pool->top_block->free >= needed
- && pool->top_block->top == (char *)PObj_bufstart(str) + old_size) {
+ && pool->top_block->top == (char *)Buffer_bufstart(str) + old_size) {
pool->top_block->free -= needed;
pool->top_block->top += needed;
- PObj_buflen(str) = new_size - sizeof (void*);
+ Buffer_buflen(str) = new_size - sizeof (void*);
return;
}
@@ -826,18 +768,18 @@
copysize = str->bufused;
if (!PObj_COW_TEST(str))
- pool->guaranteed_reclaimable += PObj_buflen(str);
+ pool->guaranteed_reclaimable += Buffer_buflen(str);
- pool->possibly_reclaimable += PObj_buflen(str);
+ pool->possibly_reclaimable += Buffer_buflen(str);
mem = (char *)mem_allocate(interp, new_size, pool);
mem += sizeof (void *);
/* copy mem from strstart, *not* bufstart */
oldmem = str->strstart;
- PObj_bufstart(str) = (void *)mem;
+ Buffer_bufstart(str) = (void *)mem;
str->strstart = mem;
- PObj_buflen(str) = new_size - sizeof (void*);
+ Buffer_buflen(str) = new_size - sizeof (void*);
/* We shouldn't ever have a 0 from size, but we do. If we can track down
* those bugs, this can be removed which would make things cheaper */
@@ -918,9 +860,6 @@
dest_arena->constant_string_header_pool,
source_arena->constant_string_header_pool);
- Parrot_gc_merge_buffer_pools(dest_interp,
- dest_arena->pmc_ext_pool, source_arena->pmc_ext_pool);
-
for (i = 0; i < source_arena->num_sized; ++i) {
if (!source_arena->sized_header_pools[i])
continue;
@@ -959,7 +898,7 @@
{
ASSERT_ARGS(Parrot_gc_merge_buffer_pools)
Small_Object_Arena *cur_arena;
- void **free_list_end;
+ GC_MS_PObj_Wrapper *free_list_end;
PARROT_ASSERT(dest->object_size == source->object_size);
PARROT_ASSERT((dest->name == NULL && source->name == NULL)
@@ -969,12 +908,16 @@
/* append new free_list to old */
/* XXX this won't work with, e.g., gc_gms */
- free_list_end = &dest->free_list;
+ free_list_end = dest->free_list;
- while (*free_list_end)
- free_list_end = (void **)*free_list_end;
+ if (free_list_end == NULL)
+ dest->free_list = source->free_list;
+ else {
+ while (free_list_end->next_ptr)
+ free_list_end = free_list_end->next_ptr;
- *free_list_end = source->free_list;
+ free_list_end->next_ptr = source->free_list;
+ }
/* now append source arenas */
cur_arena = source->last_Arena;
@@ -1081,9 +1024,6 @@
(void *)pass, sweep_cb_buf);
}
- free_pool(interp->arena_base->pmc_ext_pool);
- interp->arena_base->pmc_ext_pool = NULL;
-
mem_internal_free(interp->arena_base->sized_header_pools);
if (interp->arena_base->attrib_pools)
mem_internal_free(interp->arena_base->attrib_pools);
@@ -1348,8 +1288,7 @@
for (i = 0; i < arena->used; i++) {
if (!PObj_on_free_list_TEST(p)) {
- if (p->pmc_ext)
- PMC_next_for_GC(p) = PMCNULL;
+ PMC_next_for_GC(p) = PMCNULL;
}
p++;
}
@@ -1476,12 +1415,6 @@
Returns the number of PMCs that are marked as needing timely destruction.
-=item C<UINTVAL Parrot_gc_extended_pmcs(PARROT_INTERP)>
-
-Returns the number of extended PMCs.
-
-=cut
-
*/
size_t
@@ -1548,14 +1481,6 @@
return arena_base->num_early_gc_PMCs;
}
-UINTVAL
-Parrot_gc_extended_pmcs(PARROT_INTERP)
-{
- ASSERT_ARGS(Parrot_gc_extended_pmcs)
- const Arenas * const arena_base = interp->arena_base;
- return arena_base->num_extended_PMCs;
-}
-
/*
=item C<void Parrot_block_GC_mark(PARROT_INTERP)>
Modified: branches/pluggable_runcore/src/gc/gc_inf.c
==============================================================================
--- branches/pluggable_runcore/src/gc/gc_inf.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/gc_inf.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -221,8 +221,7 @@
Initializes the function pointers in a new pool. When a new pool is created
we assign several function pointers to it for managing memory in the pool.
In this way we can treat different pools differently if they have special
-management needs. In general all PObj-like pools are treated one way, and
-other pools (such as the pmc_ext pool) are treated differently.
+management needs. In general all PObj-like pools are treated the same.
This function is mostly called from the function C<initialize_header_pools>
in F<src/gc/mark_sweep.c> at Parrot startup.
Modified: branches/pluggable_runcore/src/gc/gc_ms.c
==============================================================================
--- branches/pluggable_runcore/src/gc/gc_ms.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/gc_ms.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -29,13 +29,6 @@
__attribute__nonnull__(3)
FUNC_MODIFIES(*pool);
-static void gc_ms_add_free_pmc_ext(SHIM_INTERP,
- ARGMOD(Small_Object_Pool *pool),
- ARGIN(void *to_add))
- __attribute__nonnull__(2)
- __attribute__nonnull__(3)
- FUNC_MODIFIES(*pool);
-
static void gc_ms_alloc_objects(PARROT_INTERP,
ARGMOD(Small_Object_Pool *pool))
__attribute__nonnull__(1)
@@ -54,14 +47,6 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*pool);
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-static void * gc_ms_get_free_pmc_ext(PARROT_INTERP,
- ARGMOD(Small_Object_Pool *pool))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(*pool);
-
static void gc_ms_mark_and_sweep(PARROT_INTERP, UINTVAL flags)
__attribute__nonnull__(1);
@@ -92,9 +77,6 @@
#define ASSERT_ARGS_gc_ms_add_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(pool) \
|| PARROT_ASSERT_ARG(to_add)
-#define ASSERT_ARGS_gc_ms_add_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- 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) \
|| PARROT_ASSERT_ARG(pool)
@@ -104,9 +86,6 @@
#define ASSERT_ARGS_gc_ms_get_free_object __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool)
-#define ASSERT_ARGS_gc_ms_get_free_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_gc_ms_mark_and_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_gc_ms_more_traceable_objects __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -348,6 +327,7 @@
gc_ms_more_traceable_objects(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
{
ASSERT_ARGS(gc_ms_more_traceable_objects)
+
if (pool->skip)
pool->skip = 0;
else {
@@ -359,9 +339,14 @@
/* requires that num_free_objects be updated in Parrot_gc_mark_and_sweep.
If gc is disabled, then we must check the free list directly. */
- if (!pool->free_list
- || pool->num_free_objects < pool->replenish_level)
+#if GC_USE_LAZY_ALLOCATOR
+ if ((!pool->free_list || pool->num_free_objects < pool->replenish_level)
+ && !pool->newfree)
(*pool->alloc_objects) (interp, pool);
+#else
+ if (!pool->free_list || pool->num_free_objects < pool->replenish_level)
+ (*pool->alloc_objects) (interp, pool);
+#endif
}
/*
@@ -381,12 +366,12 @@
ARGIN(void *to_add))
{
ASSERT_ARGS(gc_ms_add_free_object)
- PObj *object = (PObj *)to_add;
+ GC_MS_PObj_Wrapper *object = (GC_MS_PObj_Wrapper *)to_add;
PObj_flags_SETTO(object, PObj_on_free_list_FLAG);
- ((GC_MS_PObj_Wrapper*)object)->next_ptr = (PObj *)pool->free_list;
- pool->free_list = object;
+ object->next_ptr = pool->free_list;
+ pool->free_list = object;
}
/*
@@ -444,7 +429,8 @@
pool->free_list = ((GC_MS_PObj_Wrapper*)ptr)->next_ptr;
#endif
- PObj_flags_SETTO(ptr, 0);
+ /* PObj_flags_SETTO(ptr, 0); */
+ memset(ptr, 0, pool->object_size);
--pool->num_free_objects;
@@ -469,6 +455,7 @@
{
ASSERT_ARGS(gc_ms_alloc_objects)
/* Setup memory for the new objects */
+
Small_Object_Arena * const new_arena =
mem_internal_allocate_typed(Small_Object_Arena);
@@ -480,6 +467,8 @@
Parrot_append_arena_in_pool(interp, pool, new_arena, size);
+ PARROT_ASSERT(pool->last_Arena);
+
Parrot_add_to_free_list(interp, pool, new_arena);
/* Allocate more next time */
@@ -507,118 +496,6 @@
=back
-=head2 MS PMC_EXT Pool functions
-
-=over 4
-
-=item C<void gc_ms_pmc_ext_pool_init(Small_Object_Pool *pool)>
-
-Initialize the PMC_EXT pool functions. This is done separately from other
-pools.
-
-=cut
-
-*/
-
-void
-gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
-{
- ASSERT_ARGS(gc_ms_pmc_ext_pool_init)
- pool->add_free_object = gc_ms_add_free_pmc_ext;
- pool->get_free_object = gc_ms_get_free_pmc_ext;
- pool->alloc_objects = gc_ms_alloc_objects;
- pool->more_objects = gc_ms_alloc_objects;
-}
-
-
-/*
-
-=item C<static void gc_ms_add_free_pmc_ext(PARROT_INTERP, Small_Object_Pool
-*pool, void *to_add)>
-
-Add a freed PMC_EXT structure to the free list in the PMC_EXT pool. Objects
-on the free list can be reused later.
-
-=cut
-
-*/
-
-static void
-gc_ms_add_free_pmc_ext(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGIN(void *to_add))
-{
- ASSERT_ARGS(gc_ms_add_free_pmc_ext)
- PMC_EXT * const object = (PMC_EXT *)to_add;
- object->_metadata = NULL;
-
- /* yes, this cast is a hack for now, but a pointer is a pointer */
- object->_next_for_GC = (PMC *)pool->free_list;
- pool->free_list = object;
-}
-
-/*
-
-=item C<static void * gc_ms_get_free_pmc_ext(PARROT_INTERP, Small_Object_Pool
-*pool)>
-
-Get a new PMC_EXT structure from the free pool and return it.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-PARROT_WARN_UNUSED_RESULT
-static void *
-gc_ms_get_free_pmc_ext(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
-{
- ASSERT_ARGS(gc_ms_get_free_pmc_ext)
- PMC_EXT *ptr;
- PMC_EXT *free_list = (PMC_EXT *)pool->free_list;
-
-#if GC_USE_LAZY_ALLOCATOR
- if (!free_list && !pool->newfree) {
- (*pool->more_objects)(interp, pool);
- free_list = (PMC_EXT *)pool->free_list;
- }
-
- if (!free_list) {
- Small_Object_Arena * const arena = pool->last_Arena;
-
- ptr = (PMC_EXT *)pool->newfree;
- pool->newfree = (void *)((char *)pool->newfree + pool->object_size);
-
- if (pool->newfree >= pool->newlast)
- pool->newfree = NULL;
- arena->used++;
- PARROT_ASSERT(ptr < (PMC_EXT *)pool->newlast);
- }
- else {
- ptr = free_list;
- pool->free_list = ptr->_next_for_GC;
- ptr->_next_for_GC = NULL;
- }
-#else
- /* if we don't have any objects */
- if (!free_list) {
- (*pool->more_objects)(interp, pool);
- free_list = (PMC_EXT *)pool->free_list;
- }
-
- ptr = free_list;
- pool->free_list = ptr->_next_for_GC;
- ptr->_next_for_GC = NULL;
-#endif
-
- --pool->num_free_objects;
-
- return ptr;
-}
-
-
-/*
-
-=back
-
=cut
*/
Modified: branches/pluggable_runcore/src/gc/gc_private.h
==============================================================================
--- branches/pluggable_runcore/src/gc/gc_private.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/gc_private.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -68,7 +68,7 @@
this on at the same time that you increase the size of allocated arenas.
increase *_HEADERS_PER_ALLOC and GC_FIXED_SIZE_POOL_SIZE to be large
enough to satisfy most startup costs. */
-#define GC_USE_LAZY_ALLOCATOR 0
+#define GC_USE_LAZY_ALLOCATOR 1
/* We're using this here to add an additional pointer to a PObj without
having to actually add an entire pointer to every PObj-alike structure
@@ -77,9 +77,9 @@
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 union GC_MS_PObj_Wrapper {
- PObj obj;
- PObj *next_ptr;
+typedef struct GC_MS_PObj_Wrapper {
+ size_t flags;
+ struct GC_MS_PObj_Wrapper * next_ptr;
} GC_MS_PObj_Wrapper;
typedef struct Small_Object_Arena {
@@ -180,7 +180,7 @@
size_t num_free_objects; /* number of resources in the free pool */
int skip;
size_t replenish_level;
- void *free_list;
+ GC_MS_PObj_Wrapper * free_list;
/* adds a free object to the pool's free list */
add_free_object_fn_type add_free_object;
get_free_object_fn_type get_free_object;
@@ -216,9 +216,7 @@
Memory_Pool *constant_string_pool;
struct Small_Object_Pool *string_header_pool;
struct Small_Object_Pool *pmc_pool;
- struct Small_Object_Pool *pmc_ext_pool;
struct Small_Object_Pool *constant_pmc_pool;
- struct Small_Object_Pool *buffer_header_pool;
struct Small_Object_Pool *constant_string_header_pool;
struct Small_Object_Pool **sized_header_pools;
size_t num_sized;
@@ -257,7 +255,6 @@
during collection */
UINTVAL num_early_gc_PMCs; /* how many PMCs want immediate destruction */
UINTVAL num_early_PMCs_seen; /* how many such PMCs has GC seen */
- UINTVAL num_extended_PMCs; /* active PMCs having pmc_ext */
PMC* gc_mark_start; /* first PMC marked during a GC run */
PMC* gc_mark_ptr; /* last PMC marked during a GC run */
PMC* gc_trace_ptr; /* last PMC trace_children was called on */
@@ -552,6 +549,12 @@
PARROT_WARN_UNUSED_RESULT
size_t aligned_string_size(size_t len);
+void check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Memory_Pool * pool))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ FUNC_MODIFIES(* pobj)
+ FUNC_MODIFIES(* pool);
+
void compact_pool(PARROT_INTERP, ARGMOD(Memory_Pool *pool))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -579,6 +582,9 @@
#define ASSERT_ARGS_aligned_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(buffer)
#define ASSERT_ARGS_aligned_string_size __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_check_buffer_ptr __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(pobj) \
+ || PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_compact_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pool)
@@ -674,15 +680,9 @@
/* HEADERIZER BEGIN: src/gc/gc_ms.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-void gc_ms_pmc_ext_pool_init(ARGMOD(Small_Object_Pool *pool))
- __attribute__nonnull__(1)
- FUNC_MODIFIES(*pool);
-
void Parrot_gc_ms_init(PARROT_INTERP)
__attribute__nonnull__(1);
-#define ASSERT_ARGS_gc_ms_pmc_ext_pool_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(pool)
#define ASSERT_ARGS_Parrot_gc_ms_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Modified: branches/pluggable_runcore/src/gc/generational_ms.c
==============================================================================
--- branches/pluggable_runcore/src/gc/generational_ms.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/generational_ms.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -1081,7 +1081,7 @@
/* if this may be an aggregate store it in IGP list, thus making
* it a possible root for this generation
*/
- if (PObj_is_PMC_TEST((PObj *)_new) && ((PMC *)_new)->pmc_ext)
+ if (PObj_is_PMC_TEST((PObj *)_new))
gc_gms_store_igp(interp, nh);
/* promote RHS to old generation of aggregate */
@@ -1494,7 +1494,7 @@
++interp->arena_base->num_early_PMCs_seen;
h = PObj_to_GMSH(obj);
/* unsnap it from white, put it into gray or black */
- if (PObj_is_PMC_TEST(obj) && ((PMC*)obj)->pmc_ext)
+ if (PObj_is_PMC_TEST(obj))
gc_gms_setto_gray(interp, h, priority);
else
gc_gms_setto_black(interp, h, priority);
@@ -1693,14 +1693,6 @@
--arena_base->num_early_gc_PMCs;
if (PObj_active_destroy_TEST(obj))
VTABLE_destroy(interp, (PMC *)obj);
- if (PObj_is_PMC_EXT_TEST(obj) && obj->pmc_ext) {
- /* if the PMC has a PMC_EXT structure,
- * return it to the pool
- */
- Small_Object_Pool * const ext_pool = arena_base->pmc_ext_pool;
- ext_pool->add_free_object(interp, ext_pool, obj->pmc_ext);
- }
-
}
pool->free_list = pool->white;
return 0;
Modified: branches/pluggable_runcore/src/gc/incremental_ms.c
==============================================================================
--- branches/pluggable_runcore/src/gc/incremental_ms.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/incremental_ms.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -519,7 +519,7 @@
{
ASSERT_ARGS(gc_ims_add_free_object)
*(void **)to_add = pool->free_list;
- pool->free_list = to_add;
+ pool->free_list = (GC_MS_PObj_Wrapper*)to_add;
#if DISABLE_GC_DEBUG
UNUSED(interp);
#else
@@ -561,7 +561,7 @@
(*pool->alloc_objects) (interp, pool);
ptr = (PObj *)pool->free_list;
- pool->free_list = *(void **)ptr;
+ pool->free_list = (GC_MS_PObj_Wrapper*)(*(void **)ptr);
/*
* buffers are born black, PMCs not yet?
@@ -823,7 +823,6 @@
g_ims->state = GC_IMS_COLLECT;
g_ims->n_objects = n_objects;
- g_ims->n_extended_PMCs = arena_base->num_extended_PMCs;
}
Modified: branches/pluggable_runcore/src/gc/mark_sweep.c
==============================================================================
--- branches/pluggable_runcore/src/gc/mark_sweep.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/gc/mark_sweep.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -33,7 +33,7 @@
static void free_buffer(SHIM_INTERP,
ARGMOD(Small_Object_Pool *pool),
- ARGMOD(PObj *b))
+ ARGMOD(Buffer *b))
__attribute__nonnull__(2)
__attribute__nonnull__(3)
FUNC_MODIFIES(*pool)
@@ -41,7 +41,7 @@
static void free_buffer_malloc(SHIM_INTERP,
SHIM(Small_Object_Pool *pool),
- ARGMOD(PObj *b))
+ ARGMOD(Buffer *b))
__attribute__nonnull__(3)
FUNC_MODIFIES(*b);
@@ -54,11 +54,6 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool * new_buffer_pool(PARROT_INTERP)
- __attribute__nonnull__(1);
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
static Small_Object_Pool * new_bufferlike_pool(PARROT_INTERP,
size_t actual_buffer_size)
__attribute__nonnull__(1);
@@ -98,8 +93,6 @@
#define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(p)
-#define ASSERT_ARGS_new_buffer_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_new_bufferlike_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_new_pmc_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -140,7 +133,6 @@
arena_base->gc_trace_ptr = NULL;
arena_base->gc_mark_start = NULL;
arena_base->num_early_PMCs_seen = 0;
- arena_base->num_extended_PMCs = 0;
}
/*
@@ -275,6 +267,8 @@
Parrot_gc_sweep_pool(PARROT_INTERP, ARGMOD(Small_Object_Pool *pool))
{
ASSERT_ARGS(Parrot_gc_sweep_pool)
+ PObj *b;
+ UINTVAL i;
UINTVAL total_used = 0;
const UINTVAL object_size = pool->object_size;
@@ -295,11 +289,11 @@
}
#endif
- /* Run through all the buffer header pools and mark */
+ /* Run through all the PObj header pools and mark */
for (cur_arena = pool->last_Arena; cur_arena; cur_arena = cur_arena->prev) {
const size_t objects_end = cur_arena->used;
- Buffer *b = (Buffer *)cur_arena->start_objects;
UINTVAL i;
+ b = (PObj *)cur_arena->start_objects;
/* loop only while there are objects in the arena */
for (i = objects_end; i; i--) {
@@ -344,7 +338,7 @@
pool->add_free_object(interp, pool, b);
}
next:
- b = (Buffer *)((char *)b + object_size);
+ b = (PObj *)((char *)b + object_size);
}
}
@@ -390,10 +384,8 @@
=item C<void mark_special(PARROT_INTERP, PMC *obj)>
-Marks the children of a special PMC. Handles the marking necessary
-for shared PMCs, and ensures timely marking of high-priority PMCs.
-Ensures PMC_EXT structures are properly organized for garbage
-collection.
+Handles marking a PMC. Specifically, calls the VTABLE_mark for that PMC
+if one is present. Also handles marking shared PMCs.
=cut
@@ -438,10 +430,8 @@
else
hi_prio = 0;
- if (obj->pmc_ext) {
+ {
PMC * const tptr = arena_base->gc_trace_ptr;
-
- ++arena_base->num_extended_PMCs;
/*
* XXX this basically invalidates the high-priority marking
* of PMCs by putting all PMCs onto the front of the list.
@@ -706,8 +696,7 @@
PObj *p)>
Frees a PMC that is no longer being used. Calls a custom C<destroy> VTABLE
-method if one is available. If the PMC uses a PMC_EXT structure, that is freed
-as well.
+method if one is available.
=cut
@@ -725,19 +714,7 @@
if (PObj_needs_early_gc_TEST(p))
--arena_base->num_early_gc_PMCs;
- if (PObj_active_destroy_TEST(p))
- VTABLE_destroy(interp, pmc);
-
- if (PObj_is_PMC_EXT_TEST(p))
- Parrot_gc_free_pmc_ext(interp, pmc);
-
-#ifndef NDEBUG
-
- pmc->pmc_ext = (PMC_EXT *)0xdeadbeef;
- pmc->vtable = (VTABLE *)0xdeadbeef;
-
-#endif
-
+ Parrot_pmc_destroy(interp, pmc);
}
@@ -765,7 +742,12 @@
Small_Object_Pool * const pool =
new_small_object_pool(buffer_size, num_headers);
- pool->gc_object = NULL;
+#ifdef GC_IS_MALLOC
+ pool->gc_object = free_buffer_malloc;
+#else
+ pool->gc_object = (gc_object_fn_type)free_buffer;
+#endif
+
pool->mem_pool = interp->arena_base->memory_pool;
(interp->arena_base->init_pool)(interp, pool);
return pool;
@@ -806,15 +788,13 @@
return pool;
}
-
-
/*
-=item C<static Small_Object_Pool * new_buffer_pool(PARROT_INTERP)>
-
-Creates a new C<Small_Object_Pool> structure for managing buffer objects.
+=item C<static Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL
+constant)>
-Non-constant strings and plain Buffers are stored in the sized header pools.
+Creates a new pool for C<STRING>s and returns it. This calls
+C<get_bufferlike_pool> internally, which in turn calls C<new_bufferlike_pool>.
=cut
@@ -823,16 +803,19 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
static Small_Object_Pool *
-new_buffer_pool(PARROT_INTERP)
+new_string_pool(PARROT_INTERP, INTVAL constant)
{
- ASSERT_ARGS(new_buffer_pool)
- Small_Object_Pool * const pool = get_bufferlike_pool(interp, sizeof (Buffer));
+ ASSERT_ARGS(new_string_pool)
+ Small_Object_Pool *pool;
+ if (constant) {
+ pool = new_bufferlike_pool(interp, sizeof (STRING));
+ pool->gc_object = NULL;
+ pool->mem_pool = interp->arena_base->constant_string_pool;
+ }
+ else
+ pool = get_bufferlike_pool(interp, sizeof (STRING));
-#ifdef GC_IS_MALLOC
- pool->gc_object = free_buffer_malloc;
-#else
- pool->gc_object = free_buffer;
-#endif
+ pool->objects_per_alloc = STRING_HEADERS_PER_ALLOC;
return pool;
}
@@ -840,7 +823,7 @@
/*
=item C<static void free_buffer_malloc(PARROT_INTERP, Small_Object_Pool *pool,
-PObj *b)>
+Buffer *b)>
Frees the given buffer, returning the storage space to the operating system
and removing it from Parrot's memory management system. If the buffer is COW,
@@ -852,30 +835,30 @@
static void
free_buffer_malloc(SHIM_INTERP, SHIM(Small_Object_Pool *pool),
- ARGMOD(PObj *b))
+ ARGMOD(Buffer *b))
{
ASSERT_ARGS(free_buffer_malloc)
/* free allocated space at (int *)bufstart - 1, but not if it used COW or is
* external */
- PObj_buflen(b) = 0;
+ Buffer_buflen(b) = 0;
- if (!PObj_bufstart(b) || PObj_is_external_or_free_TESTALL(b))
+ if (!Buffer_bufstart(b) || PObj_is_external_or_free_TESTALL(b))
return;
if (PObj_COW_TEST(b)) {
- INTVAL * const refcount = PObj_bufrefcountptr(b);
+ INTVAL * const refcount = Buffer_bufrefcountptr(b);
if (--(*refcount) == 0) {
mem_sys_free(refcount); /* the actual bufstart */
}
}
else
- mem_sys_free(PObj_bufrefcountptr(b));
+ mem_sys_free(Buffer_bufrefcountptr(b));
}
/*
-=item C<static void free_buffer(PARROT_INTERP, Small_Object_Pool *pool, PObj
+=item C<static void free_buffer(PARROT_INTERP, Small_Object_Pool *pool, Buffer
*b)>
Frees a buffer, returning it to the memory pool for Parrot to possibly
@@ -886,7 +869,7 @@
*/
static void
-free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGMOD(PObj *b))
+free_buffer(SHIM_INTERP, ARGMOD(Small_Object_Pool *pool), ARGMOD(Buffer *b))
{
ASSERT_ARGS(free_buffer)
Memory_Pool * const mem_pool = (Memory_Pool *)pool->mem_pool;
@@ -895,44 +878,12 @@
* shouldn't happen */
if (mem_pool) {
if (!PObj_COW_TEST(b))
- mem_pool->guaranteed_reclaimable += PObj_buflen(b);
+ mem_pool->guaranteed_reclaimable += Buffer_buflen(b);
- mem_pool->possibly_reclaimable += PObj_buflen(b);
+ mem_pool->possibly_reclaimable += Buffer_buflen(b);
}
- PObj_buflen(b) = 0;
-}
-
-
-/*
-
-=item C<static Small_Object_Pool * new_string_pool(PARROT_INTERP, INTVAL
-constant)>
-
-Creates a new pool for C<STRING>s and returns it. This calls
-C<get_bufferlike_pool> internally, which in turn calls C<new_bufferlike_pool>.
-
-=cut
-
-*/
-
-PARROT_WARN_UNUSED_RESULT
-PARROT_CANNOT_RETURN_NULL
-static Small_Object_Pool *
-new_string_pool(PARROT_INTERP, INTVAL constant)
-{
- ASSERT_ARGS(new_string_pool)
- Small_Object_Pool *pool;
- if (constant) {
- pool = new_bufferlike_pool(interp, sizeof (STRING));
- pool->mem_pool = interp->arena_base->constant_string_pool;
- }
- else
- pool = get_bufferlike_pool(interp, sizeof (STRING));
-
- pool->objects_per_alloc = STRING_HEADERS_PER_ALLOC;
-
- return pool;
+ Buffer_buflen(b) = 0;
}
@@ -985,10 +936,10 @@
=item C<void initialize_header_pools(PARROT_INTERP)>
The initialization routine for the interpreter's header pools. Initializes
-pools for string headers, constant string headers, buffers, PMCs, PMC_EXTs, and
+pools for string headers, constant string headers, buffers, PMCs and
constant PMCs.
-The C<string_header_pool> and C<buffer_header_pool> are actually both in the
+The C<string_header_pool> actually lives in the
sized pools, although no other sized pools are created here.
=cut
@@ -1007,11 +958,9 @@
/* Init the buffer header pool
*
- * The buffer_header_pool and the string_header_pool actually live in the
+ * The string_header_pool actually lives in the
* sized_header_pools. These pool pointers only provide faster access in
* new_*_header */
- arena_base->buffer_header_pool = new_buffer_pool(interp);
- arena_base->buffer_header_pool->name = "buffer_header";
/* Init the string header pool */
arena_base->string_header_pool = new_string_pool(interp, 0);
@@ -1021,26 +970,6 @@
arena_base->pmc_pool = new_pmc_pool(interp);
arena_base->pmc_pool->name = "pmc";
- /* pmc extension buffer */
- arena_base->pmc_ext_pool =
- new_small_object_pool(sizeof (PMC_EXT), 1024);
-
-#if PARROT_GC_MS
- /*
- * pmc_ext isn't a managed item. If a PMC has a pmc_ext structure
- * it is returned to the pool instantly - the structure is never
- * marked.
- * Use GS MS pool functions
- */
- gc_ms_pmc_ext_pool_init(arena_base->pmc_ext_pool);
-#elif PARROT_GC_INF
- arena_base->init_pool(interp, arena_base->pmc_ext_pool);
-#else
- /* rational, consistant behavior (as yet unwritten) */
-#endif
-
- arena_base->pmc_ext_pool->name = "pmc_ext";
-
/* constant PMCs */
arena_base->constant_pmc_pool = new_pmc_pool(interp);
arena_base->constant_pmc_pool->name = "constant_pmc";
@@ -1225,7 +1154,7 @@
ASSERT_ARGS(Parrot_gc_allocate_new_attributes_arena)
const size_t num_items = pool->objects_per_alloc;
const size_t item_size = pool->attr_size;
- const size_t total_size = sizeof (PMC_Attribute_Arena) + (pool->attr_size * num_items);
+ const size_t total_size = sizeof (PMC_Attribute_Arena) + (item_size * num_items);
size_t i;
PMC_Attribute_Free_List *list, *next, *first;
PMC_Attribute_Arena * const new_arena = (PMC_Attribute_Arena *)mem_internal_allocate(
@@ -1246,7 +1175,8 @@
list->next = pool->free_list;
pool->free_list = first;
#endif
- pool->total_objects += num_items;
+ pool->num_free_objects += num_items;
+ pool->total_objects += num_items;
}
PARROT_CANNOT_RETURN_NULL
@@ -1260,28 +1190,28 @@
const size_t idx = size - sizeof (void *);
if (pools == NULL) {
- const size_t total_size = idx + GC_ATTRIB_POOLS_HEADROOM;
+ const size_t total_length = idx + GC_ATTRIB_POOLS_HEADROOM;
+ const size_t total_size = total_length * sizeof (void *);
/* Allocate more then we strictly need, hoping that we can reduce the
number of resizes. 8 is just an arbitrary number */
- pools = (PMC_Attribute_Pool **)mem_internal_allocate(total_size
- * sizeof (PMC_Attribute_Pool *));
- memset(pools, 0, total_size * sizeof (void*));
+ pools = (PMC_Attribute_Pool **)mem_internal_allocate(total_size);
+ memset(pools, 0, total_size);
arenas->attrib_pools = pools;
- arenas->num_attribs = total_size;
+ arenas->num_attribs = total_length;
}
if (arenas->num_attribs < idx) {
- const size_t total_size = idx + GC_ATTRIB_POOLS_HEADROOM;
+ const size_t total_length = idx + GC_ATTRIB_POOLS_HEADROOM;
+ const size_t total_size = total_length * sizeof (void *);
const size_t current_size = arenas->num_attribs;
- const size_t diff = total_size - current_size;
+ const size_t diff = total_length - current_size;
- pools = (PMC_Attribute_Pool **)mem_internal_realloc(pools, total_size
- * sizeof (PMC_Attribute_Pool *));
+ pools = (PMC_Attribute_Pool **)mem_internal_realloc(pools, total_size);
memset(pools + current_size, 0, diff * sizeof (void *));
arenas->attrib_pools = pools;
- arenas->num_attribs = total_size;
+ arenas->num_attribs = total_length;
}
if (pools[idx] == NULL)
- pools[idx] = Parrot_gc_create_attrib_pool(interp, attrib_size);
+ pools[idx] = Parrot_gc_create_attrib_pool(interp, size);
return pools[idx];
}
Modified: branches/pluggable_runcore/src/global_setup.c
==============================================================================
--- branches/pluggable_runcore/src/global_setup.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/global_setup.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -164,10 +164,7 @@
Parrot_platform_init_code();
#endif
- parrot_alloc_vtables(interp);
-
/* Call base vtable class constructor methods */
- Parrot_initialize_core_pmcs(interp, 0);
parrot_global_setup_2(interp);
Parrot_initialize_core_pmcs(interp, 1);
Modified: branches/pluggable_runcore/src/interp/inter_create.c
==============================================================================
--- branches/pluggable_runcore/src/interp/inter_create.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/interp/inter_create.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -178,6 +178,8 @@
*/
Parrot_str_init(interp);
+ Parrot_initialize_core_vtables(interp);
+
/* Set up the MMD struct */
interp->binop_mmd_funcs = NULL;
Modified: branches/pluggable_runcore/src/interp/inter_misc.c
==============================================================================
--- branches/pluggable_runcore/src/interp/inter_misc.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/interp/inter_misc.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -252,9 +252,6 @@
case IMPATIENT_PMCS:
ret = Parrot_gc_impatient_pmcs(interp);
break;
- case EXTENDED_PMCS:
- ret = Parrot_gc_extended_pmcs(interp);
- break;
case CURRENT_RUNCORE:
{
STRING *name = interp->run_core->name;
Modified: branches/pluggable_runcore/src/jit/i386/jit_defs.c
==============================================================================
--- branches/pluggable_runcore/src/jit/i386/jit_defs.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/jit/i386/jit_defs.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -1214,55 +1214,6 @@
jit_info->native_ptr, (f)); \
emitm_calll(jit_info->native_ptr, EXEC_CALLDISP);
-/* new_p_ic */
-void
-Parrot_jit_vtable_newp_ic_op(Parrot_jit_info_t *jit_info,
- PARROT_INTERP)
-{
- int p1, i2;
- op_info_t *op_info = &interp->op_info_table[*jit_info->cur_op];
- size_t offset = offsetof(VTABLE, init);
-
- PARROT_ASSERT(op_info->types[0] == PARROT_ARG_P);
- p1 = *(jit_info->cur_op + 1);
- i2 = *(jit_info->cur_op + 2);
-
- if (i2 <= 0 || i2 >= interp->n_vtable_max)
- Parrot_ex_throw_from_c_args(interp, NULL, 1,
- "Illegal PMC enum (%d) in new", i2);
-
- /* get interpreter */
- Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
-
- /* push pmc enum and interpreter */
- emitm_pushl_i(jit_info->native_ptr, i2);
- emitm_pushl_r(jit_info->native_ptr, emit_ECX);
-#if EXEC_CAPABLE
- if (jit_info->objfile) {
- CALL("pmc_new_noinit");
- }
- else
-#endif
- {
- call_func(jit_info, (void (*) (void))pmc_new_noinit);
- }
- /* result = eax push pmc */
- emitm_pushl_r(jit_info->native_ptr, emit_EAX);
- /* store in PMC too */
- emitm_movl_r_m(interp, jit_info->native_ptr,
- emit_EAX, emit_EBX, emit_None, 1, REG_OFFS_PMC(p1));
- /* push interpreter */
- Parrot_jit_emit_get_INTERP(interp, jit_info->native_ptr, emit_ECX);
- emitm_pushl_r(jit_info->native_ptr, emit_ECX);
- /* mov (offs)%eax, %eax i.e. $1->vtable */
- emitm_movl_m_r(interp, jit_info->native_ptr, emit_EAX, emit_EAX, emit_None, 1,
- offsetof(struct PMC, vtable));
- /* call *(offset)eax */
- emitm_callm(jit_info->native_ptr, emit_EAX, emit_None, emit_None, offset);
- /* adjust 4 args pushed */
- emitm_addb_i_r(jit_info->native_ptr, 16, emit_ESP);
-}
-
# undef IREG
# undef NREG
# undef SREG
@@ -2265,16 +2216,16 @@
break;
case 'v':
break;
- case 'b': /* buffer (void*) pass PObj_bufstart(SReg) */
+ case 'b': /* buffer (void*) pass Buffer_bufstart(SReg) */
emitm_call_cfunc(pc, get_nci_S);
emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
- (size_t) &PObj_bufstart((STRING *) NULL));
+ (size_t) &Buffer_bufstart((STRING *) NULL));
emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
break;
- case 'B': /* buffer (void**) pass &PObj_bufstart(SReg) */
+ case 'B': /* buffer (void**) pass &Buffer_bufstart(SReg) */
emitm_call_cfunc(pc, get_nci_S);
emitm_lea_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
- (size_t) &PObj_bufstart((STRING *) NULL));
+ (size_t) &Buffer_bufstart((STRING *) NULL));
emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
break;
case 'S':
Modified: branches/pluggable_runcore/src/jit/i386/jit_emit.h
==============================================================================
--- branches/pluggable_runcore/src/jit/i386/jit_emit.h Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/jit/i386/jit_emit.h Thu Aug 27 18:38:59 2009 (r40830)
@@ -1661,9 +1661,6 @@
/* if_p_ic */
void Parrot_jit_vtable_ifp_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-/* new_p_ic */
-void Parrot_jit_vtable_newp_ic_op(Parrot_jit_info_t *jit_info, PARROT_INTERP);
-
#endif /* JIT_VTABLE_OPS */
#if EXEC_CAPABLE
Modified: branches/pluggable_runcore/src/jit_debug.c
==============================================================================
--- branches/pluggable_runcore/src/jit_debug.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/jit_debug.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -106,6 +106,7 @@
static void
write_types(FILE *stabs, PARROT_INTERP)
{
+ /* It would be create if this function would be auto generated */
int i, j;
/* borrowed from mono */
static BaseTypes base_types[] = {
@@ -152,14 +153,14 @@
++i;
fprintf(stabs, ".stabs \"Parrot_String:T(0,%d)=s%d"
"bufstart:(0,14),%d,%d;"
- "buflen:(0,6),%d,%d;" /* XXX type */
+ "buflen:(0,6),%d,%d;"
"flags:(0,12),%d,%d;"
"bufused:(0,12),%d,%d;"
- "strstart:(0,15),%d,%d;" /* fake a char* */
+ "strstart:(0,15),%d,%d;"
";\""
"," N_LSYM ",0,0,0\n", i++, BYTE_SIZE(STRING),
- BIT_OFFSET(STRING, cache._b._bufstart), BIT_SIZE(void*),
- BIT_OFFSET(STRING, cache._b._buflen), BIT_SIZE(size_t),
+ BIT_OFFSET(STRING, _bufstart), BIT_SIZE(void*),
+ BIT_OFFSET(STRING, _buflen), BIT_SIZE(size_t),
BIT_OFFSET(STRING, flags), BIT_SIZE(UINTVAL),
BIT_OFFSET(STRING, bufused), BIT_SIZE(UINTVAL),
BIT_OFFSET(STRING, strstart), BIT_SIZE(void*));
@@ -177,35 +178,30 @@
fprintf(stabs, ";\"," N_LSYM ",0,0,0\n");
- /* PMC type */
- fprintf(stabs, ".stabs \"PMC:T(0,%d)=s%d", i, BYTE_SIZE(PMC));
- fprintf(stabs, "cache:(0,%d),%d,%d;",
- i + 1, BIT_OFFSET(PMC, cache), BIT_SIZE(UnionVal));
- fprintf(stabs, "flags:(0,%d),%d,%d;",
- i + 1, BIT_OFFSET(PMC, flags), BIT_SIZE(Parrot_UInt));
- fprintf(stabs, "vtable:*(0,%d),%d,%d;",
- i + 3, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*));
- fprintf(stabs, "data:(0,14),%d,%d;",
- BIT_OFFSET(PMC, data), BIT_SIZE(void*));
- fprintf(stabs, "pmc_ext:*(0,%d),%d,%d;",
- i, BIT_OFFSET(PMC, pmc_ext), BIT_SIZE(void*));
- fprintf(stabs, ";\"");
- fprintf(stabs, "," N_LSYM ",0,0,0\n");
-
- fprintf(stabs, ".stabs \"UnionVal:T(0,%d)=u%d"
- "int_val:(0,12),%d,%d;"
- "pmc_val:*(0,%d),%d,%d;"
+ fprintf(stabs, ".stabs \"PMC:T(0,%d)=s%d"
+ "flags:(0,12),%d,%d;"
+ "vtable:*(0,%d),%d,%d;"
+ "data:(0,14),%d,%d;"
+ "_metadata:*(0,%d),%d,%d;"
+ "_next_for_GC:*(0,%d),%d,%d;"
";\""
- "," N_LSYM ",0,0,0\n", i + 2, BYTE_SIZE(UnionVal),
- BIT_OFFSET(UnionVal, _i._int_val), BIT_SIZE(INTVAL),
- i, BIT_OFFSET(UnionVal, _ptrs._pmc_val), BIT_SIZE(void*));
+ "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(PMC),
+ BIT_OFFSET(PMC, flags), BIT_SIZE(UINTVAL),
+ i + 1, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*),
+ BIT_OFFSET(PMC, data), BIT_SIZE(void*),
+ i, BIT_OFFSET(PMC, _metadata), BIT_SIZE(void*),
+ i, BIT_OFFSET(PMC, _next_for_GC), BIT_SIZE(void*));
+
+ i++;
+
+ /* someone can add some field to this one */
fprintf(stabs, ".stabs \"VTABLE:T(0,%d)=s%d"
- "base_type:(0,%d),%d,%d;"
+ "base_type:(0,12),%d,%d;"
";\""
- "," N_LSYM ",0,0,0\n", i + 3, BYTE_SIZE(UnionVal),
- i - 1, BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL));
- i += 4;
+ "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(_vtable),
+ BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL));
+ i++;
}
/*
Modified: branches/pluggable_runcore/src/jit_debug_xcoff.c
==============================================================================
--- branches/pluggable_runcore/src/jit_debug_xcoff.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/jit_debug_xcoff.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -118,63 +118,57 @@
fprintf(stabs, ".stabx \"STRING:t%d=*%d\""
",0," C_DECL ",0\n", i, i+1);
++i;
- fprintf(stabs, ".stabx \"Parrot_String:T%d=s%d"
- "bufstart:14,%d,%d;"
- "buflen:6,%d,%d;" /* XXX type */
- "flags:12,%d,%d;"
- "bufused:12,%d,%d;"
- "strstart:15,%d,%d;" /* fake a char* */
+ fprintf(stabs, ".stabs \"Parrot_String:T(0,%d)=s%d"
+ "bufstart:(0,14),%d,%d;"
+ "buflen:(0,6),%d,%d;"
+ "flags:(0,12),%d,%d;"
+ "bufused:(0,12),%d,%d;"
+ "strstart:(0,15),%d,%d;"
";\""
- ",0," C_DECL ",0\n", i++, BYTE_SIZE(STRING),
- BIT_OFFSET(STRING, cache._b._bufstart), BIT_SIZE(void*),
- BIT_OFFSET(STRING, cache._b._buflen), BIT_SIZE(size_t),
+ "," N_LSYM ",0,0,0\n", i++, BYTE_SIZE(STRING),
+ BIT_OFFSET(STRING, _bufstart), BIT_SIZE(void*),
+ BIT_OFFSET(STRING, _buflen), BIT_SIZE(size_t),
BIT_OFFSET(STRING, flags), BIT_SIZE(UINTVAL),
BIT_OFFSET(STRING, bufused), BIT_SIZE(UINTVAL),
BIT_OFFSET(STRING, strstart), BIT_SIZE(void*));
- fprintf(stabs, ".stabx \"PMCType:T%d=e", i++);
+ fprintf(stabs, ".stabs \"PMCType:T(0,%d)=e", i++);
for (j = 0; j < interp->n_vtable_max; ++j) {
if (interp->vtables[j] && interp->vtables[j]->whoami) {
- STRING* name = interp->vtables[j]->whoami;
- fwrite(name->strstart, name->strlen, 1, stabs);
+ STRING *name = interp->vtables[j]->whoami;
+ size_t items = fwrite(name->strstart, name->strlen, 1, stabs);
+ if (!items)
+ fprintf(stderr, "Error writing stabs!\n");
fprintf(stabs, ":%d,", j);
}
}
- fprintf(stabs, ";\",0," C_DECL ",0\n");
- /* PMC type */
- fprintf(stabs, ".stabx \"PMC:T%d=s%d", i, BYTE_SIZE(PMC));
- fprintf(stabs, "cache:%d,%d,%d;",
- i + 1, BIT_OFFSET(PMC, cache), BIT_SIZE(UnionVal));
- fprintf(stabs, "flags:%d,%d,%d;",
- i + 1, BIT_OFFSET(PMC, flags), BIT_SIZE(Parrot_UInt));
- fprintf(stabs, "vtable:*%d,%d,%d;",
- i + 3, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*));
- fprintf(stabs, "data:14,%d,%d;",
- BIT_OFFSET(PMC, data), BIT_SIZE(void*));
- fprintf(stabs, "pmc_ext:*%d,%d,%d;",
- i, BIT_OFFSET(PMC, pmc_ext), BIT_SIZE(void*));
- fprintf(stabs, ";\"");
- fprintf(stabs, ",0," C_DECL ",0\n");
+ fprintf(stabs, ";\"," N_LSYM ",0,0,0\n");
- fprintf(stabs, ".stabx \"cache:%d,%d,%d;"
- "flags:12,%d,%d;"
+ fprintf(stabs, ".stabs \"PMC:T(0,%d)=s%d"
+ "flags:(0,12),%d,%d;"
+ "vtable:*(0,%d),%d,%d;"
+ "data:(0,14),%d,%d;"
+ "_metadata:*(0,%d),%d,%d;"
+ "_next_for_GC:*(0,%d),%d,%d;"
";\""
- ",0," C_DECL ",0\n",
- i + 2, BIT_SIZE(UnionVal), BIT_SIZE(Parrot_UInt));
- fprintf(stabs, ".stabx \"UnionVal:T%d=u%d"
- "int_val:12,%d,%d;"
- "pmc_val:*%d,%d,%d;"
+ "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(PMC),
+ BIT_OFFSET(PMC, flags), BIT_SIZE(UINTVAL),
+ i + 1, BIT_OFFSET(PMC, vtable), BIT_SIZE(void*),
+ BIT_OFFSET(PMC, data), BIT_SIZE(void*),
+ i, BIT_OFFSET(PMC, _metadata), BIT_SIZE(void*),
+ i, BIT_OFFSET(PMC, _next_for_GC), BIT_SIZE(void*));
+
+ i++;
+
+ /* some one can add some field to this one */
+ fprintf(stabs, ".stabs \"VTABLE:T(0,%d)=s%d"
+ "base_type:(0,12),%d,%d;"
";\""
- ",0," C_DECL ",0\n", i + 2, BYTE_SIZE(UnionVal),
- BIT_OFFSET(UnionVal, int_val), BIT_SIZE(INTVAL),
- i, BIT_OFFSET(UnionVal, pmc_val), BIT_SIZE(void*));
- fprintf(stabs, ".stabx \"VTABLE:T%d=s%d"
- "base_type:%d,%d,%d;"
- ";\""
- ",0," C_DECL ",0\n", i + 3, BYTE_SIZE(UnionVal),
- i - 1, BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL));
- i += 4;
+ "," N_LSYM ",0,0,0\n", i, BYTE_SIZE(_vtable),
+ BIT_OFFSET(VTABLE, base_type), BIT_SIZE(INTVAL));
+
+ i++;
}
Modified: branches/pluggable_runcore/src/key.c
==============================================================================
--- branches/pluggable_runcore/src/key.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/key.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -544,7 +544,7 @@
ASSERT_ARGS(key_next)
PMC *next_key;
- if (VTABLE_isa(interp, key, CONST_STRING(interp, "Key")) && key->pmc_ext) {
+ if (VTABLE_isa(interp, key, CONST_STRING(interp, "Key"))) {
GETATTR_Key_next_key(interp, key, next_key);
return next_key;
}
Modified: branches/pluggable_runcore/src/list.c
==============================================================================
--- branches/pluggable_runcore/src/list.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/list.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -342,11 +342,11 @@
/* HEADERIZER END: static */
#define chunk_list_size(list) \
- (PObj_buflen(&(list)->chunk_list) / sizeof (List_chunk *))
+ (Buffer_buflen(&(list)->chunk_list) / sizeof (List_chunk *))
/* hide the ugly cast somehow: */
#define chunk_list_ptr(list, idx) \
- ((List_chunk**) PObj_bufstart(&(list)->chunk_list))[(idx)]
+ ((List_chunk**) Buffer_bufstart(&(list)->chunk_list))[(idx)]
/*
@@ -381,7 +381,7 @@
chunk->next = NULL;
chunk->prev = NULL;
Parrot_gc_allocate_buffer_storage_aligned(interp, (Buffer *)chunk, size);
- memset(PObj_bufstart((Buffer*)chunk), 0, size);
+ memset(Buffer_bufstart((Buffer*)chunk), 0, size);
/* see also src/hash.c */
if (list->container)
@@ -520,13 +520,13 @@
}
mem_sys_memmove(
- (char *) PObj_bufstart(&prev->data) +
+ (char *) Buffer_bufstart(&prev->data) +
prev->items * list->item_size,
- (const char *) PObj_bufstart(&chunk->data),
+ (const char *) Buffer_bufstart(&chunk->data),
(MAX_ITEMS - prev->items) * list->item_size);
mem_sys_memmove(
- (char *) PObj_bufstart(&chunk->data),
- (const char *) PObj_bufstart(&chunk->data) +
+ (char *) Buffer_bufstart(&chunk->data),
+ (const char *) Buffer_bufstart(&chunk->data) +
(MAX_ITEMS - prev->items) * list->item_size,
(chunk->items - (MAX_ITEMS - prev->items))
* list->item_size);
@@ -540,9 +540,9 @@
GC_WRITE_BARRIER(interp, list->container, 0, prev);
}
mem_sys_memmove(
- (char *) PObj_bufstart(&prev->data) +
+ (char *) Buffer_bufstart(&prev->data) +
prev->items * list->item_size,
- (const char *) PObj_bufstart(&chunk->data),
+ (const char *) Buffer_bufstart(&chunk->data),
chunk->items * list->item_size);
prev->items += chunk->items;
chunk->items = 0;
@@ -583,8 +583,8 @@
chunk->flags = 0;
list->grow_policy = enum_grow_unknown;
- list->cap += PObj_buflen(&chunk->data) / list->item_size - chunk->items;
- chunk->items = PObj_buflen(&chunk->data) / list->item_size;
+ list->cap += Buffer_buflen(&chunk->data) / list->item_size - chunk->items;
+ chunk->items = Buffer_buflen(&chunk->data) / list->item_size;
}
/* XXX - still needed? - if last is empty and last->prev not full then
@@ -1227,34 +1227,34 @@
switch (type) {
case enum_type_sized:
/* copy data into list */
- memcpy(&((char *) PObj_bufstart(&chunk->data))[idx * list->item_size],
+ memcpy(&((char *) Buffer_bufstart(&chunk->data))[idx * list->item_size],
item, list->item_size);
break;
case enum_type_char:
- ((char *) PObj_bufstart(&chunk->data))[idx] = (char)PTR2INTVAL(item);
+ ((char *) Buffer_bufstart(&chunk->data))[idx] = (char)PTR2INTVAL(item);
break;
case enum_type_short:
- ((short *) PObj_bufstart(&chunk->data))[idx] = (short)PTR2INTVAL(item);
+ ((short *) Buffer_bufstart(&chunk->data))[idx] = (short)PTR2INTVAL(item);
break;
case enum_type_int:
- ((int *) PObj_bufstart(&chunk->data))[idx] = (int)PTR2INTVAL(item);
+ ((int *) Buffer_bufstart(&chunk->data))[idx] = (int)PTR2INTVAL(item);
break;
case enum_type_INTVAL:
- ((INTVAL *) PObj_bufstart(&chunk->data))[idx] = PTR2INTVAL(item);
+ ((INTVAL *) Buffer_bufstart(&chunk->data))[idx] = PTR2INTVAL(item);
break;
case enum_type_FLOATVAL:
- ((FLOATVAL *) PObj_bufstart(&chunk->data))[idx] = *(FLOATVAL *)item;
+ ((FLOATVAL *) Buffer_bufstart(&chunk->data))[idx] = *(FLOATVAL *)item;
break;
case enum_type_PMC:
if (list->container) {
GC_WRITE_BARRIER(interp, list->container,
- ((PMC **) PObj_bufstart(&chunk->data))[idx],
+ ((PMC **) Buffer_bufstart(&chunk->data))[idx],
(PMC *)item);
}
- ((PMC **) PObj_bufstart(&chunk->data))[idx] = (PMC *)item;
+ ((PMC **) Buffer_bufstart(&chunk->data))[idx] = (PMC *)item;
break;
case enum_type_STRING:
- ((STRING **) PObj_bufstart(&chunk->data))[idx] = (STRING *)item;
+ ((STRING **) Buffer_bufstart(&chunk->data))[idx] = (STRING *)item;
break;
default:
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list entry type\n");
@@ -1296,21 +1296,21 @@
switch (type) {
case enum_type_sized:
return (void *)&((char *)
- PObj_bufstart(&chunk->data))[idx * list->item_size];
+ Buffer_bufstart(&chunk->data))[idx * list->item_size];
case enum_type_char:
- return (void *)&((char *) PObj_bufstart(&chunk->data))[idx];
+ return (void *)&((char *) Buffer_bufstart(&chunk->data))[idx];
case enum_type_short:
- return (void *)&((short *) PObj_bufstart(&chunk->data))[idx];
+ return (void *)&((short *) Buffer_bufstart(&chunk->data))[idx];
case enum_type_int:
- return (void *)&((int *) PObj_bufstart(&chunk->data))[idx];
+ return (void *)&((int *) Buffer_bufstart(&chunk->data))[idx];
case enum_type_INTVAL:
- return (void *)&((INTVAL *) PObj_bufstart(&chunk->data))[idx];
+ return (void *)&((INTVAL *) Buffer_bufstart(&chunk->data))[idx];
case enum_type_FLOATVAL:
- return (void *)&((FLOATVAL *) PObj_bufstart(&chunk->data))[idx];
+ return (void *)&((FLOATVAL *) Buffer_bufstart(&chunk->data))[idx];
case enum_type_PMC:
- return (void *)&((PMC **) PObj_bufstart(&chunk->data))[idx];
+ return (void *)&((PMC **) Buffer_bufstart(&chunk->data))[idx];
case enum_type_STRING:
- return (void *)&((STRING **) PObj_bufstart(&chunk->data))[idx];
+ return (void *)&((STRING **) Buffer_bufstart(&chunk->data))[idx];
default:
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown list entry type\n");
}
@@ -1569,12 +1569,12 @@
l = list_new(interp, other->item_type);
STRUCT_COPY(l, other);
- PObj_buflen(&l->chunk_list) = 0;
- PObj_bufstart(&l->chunk_list) = NULL;
+ Buffer_buflen(&l->chunk_list) = 0;
+ Buffer_bufstart(&l->chunk_list) = NULL;
for (chunk = other->first, prev = NULL; chunk; chunk = chunk->next) {
List_chunk * const new_chunk = allocate_chunk(interp, l,
- chunk->items, PObj_buflen(&chunk->data));
+ chunk->items, Buffer_buflen(&chunk->data));
new_chunk->flags = chunk->flags;
@@ -1589,24 +1589,24 @@
switch (l->item_type) {
case enum_type_PMC:
for (i = 0; i < chunk->items; i++) {
- PMC * const op = ((PMC **) PObj_bufstart(&chunk->data))[i];
+ PMC * const op = ((PMC **) Buffer_bufstart(&chunk->data))[i];
if (op)
- ((PMC **) PObj_bufstart(&new_chunk->data))[i] =
+ ((PMC **) Buffer_bufstart(&new_chunk->data))[i] =
VTABLE_clone(interp, op);
}
break;
case enum_type_STRING:
for (i = 0; i < chunk->items; i++) {
- STRING *s = ((STRING **) PObj_bufstart(&chunk->data))[i];
+ STRING *s = ((STRING **) Buffer_bufstart(&chunk->data))[i];
if (s)
- ((STRING **) PObj_bufstart(&new_chunk->data))[i] =
+ ((STRING **) Buffer_bufstart(&new_chunk->data))[i] =
Parrot_str_copy(interp, s);
}
break;
default:
- mem_sys_memcopy(PObj_bufstart(&new_chunk->data),
- PObj_bufstart(&chunk->data), PObj_buflen(&chunk->data));
+ mem_sys_memcopy(Buffer_bufstart(&new_chunk->data),
+ Buffer_bufstart(&chunk->data), Buffer_buflen(&chunk->data));
break;
}
}
@@ -1643,7 +1643,7 @@
if (list->item_type == enum_type_PMC
|| list->item_type == enum_type_STRING) {
if (!(chunk->flags & sparse)) {
- PObj **p = ((PObj **) PObj_bufstart(&chunk->data));
+ PObj **p = ((PObj **) Buffer_bufstart(&chunk->data));
UINTVAL i;
for (i = 0; i < chunk->items; i++, ++p) {
@@ -1688,7 +1688,7 @@
if (!(chunk->flags & sparse)) {
UINTVAL i;
for (i = 0; i < chunk->items && idx < n; i++, idx++) {
- PMC ** const pos = ((PMC **) PObj_bufstart(&chunk->data)) + i;
+ PMC ** const pos = ((PMC **) Buffer_bufstart(&chunk->data)) + i;
info->thaw_ptr = pos;
(info->visit_pmc_now)(interp, *pos, info);
}
@@ -1830,8 +1830,8 @@
/* copy data over */
mem_sys_memmove(
- (char *)PObj_bufstart(&rest->data),
- (char *)PObj_bufstart(&chunk->data) + idx * list->item_size,
+ (char *)Buffer_bufstart(&rest->data),
+ (char *)Buffer_bufstart(&chunk->data) + idx * list->item_size,
items * list->item_size);
}
else {
@@ -1895,15 +1895,15 @@
list->item_size;
mem_sys_memmove(
- (char *) PObj_bufstart(&chunk->data) +
+ (char *) Buffer_bufstart(&chunk->data) +
idx * list->item_size,
- (char *) PObj_bufstart(&chunk->data) +
+ (char *) Buffer_bufstart(&chunk->data) +
(idx + n_items) * list->item_size, tmp_size);
#else
mem_sys_memmove(
- (char *) PObj_bufstart(&chunk->data) +
+ (char *) Buffer_bufstart(&chunk->data) +
idx * list->item_size,
- (char *) PObj_bufstart(&chunk->data) +
+ (char *) Buffer_bufstart(&chunk->data) +
(idx + n_items) * list->item_size,
(chunk->items - idx - n_items) * list->item_size);
#endif
Modified: branches/pluggable_runcore/src/oo.c
==============================================================================
--- branches/pluggable_runcore/src/oo.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/oo.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -143,14 +143,7 @@
/* Look up the name of the vtable function from the index. */
const INTVAL vtable_index = Parrot_str_to_int(interp, vtable_index_str);
const char * const meth_c = Parrot_vtable_slot_names[vtable_index];
- STRING *vtable_name = Parrot_str_new(interp, meth_c, 0);
-
- /* Strip leading underscores in the vtable name */
- if (Parrot_str_find_index(interp, vtable_name, CONST_STRING(interp, "__"), 0) == 0) {
- vtable_name = Parrot_str_substr(interp, vtable_name, 2,
- Parrot_str_byte_length(interp, vtable_name) - 2, NULL, 0);
- }
-
+ STRING * const vtable_name = Parrot_str_new(interp, meth_c, 0);
VTABLE_add_vtable_override(interp, self, vtable_name, vtable_sub);
}
}
@@ -279,8 +272,7 @@
if (!PMC_IS_NULL(dest)) {
PARROT_ASSERT(!PMC_IS_NULL(class_));
PARROT_ASSERT(class_->vtable->base_type == enum_class_Class);
- obj = (Parrot_Object_attributes *)
- Parrot_oo_new_object_attrs(interp, class_);
+ obj = PARROT_OBJECT(pmc);
cloned = dest;
}
else {
@@ -299,9 +291,8 @@
/* Flag that it is an object */
PObj_is_object_SET(cloned);
- /* Now create the underlying structure, and clone attributes list.class. */
- cloned_guts = mem_allocate_typed(Parrot_Object_attributes);
- PMC_data(cloned) = cloned_guts;
+ /* Now clone attributes list.class. */
+ cloned_guts = (Parrot_Object_attributes *) PMC_data(cloned);
cloned_guts->_class = obj->_class;
cloned_guts->attrib_store = NULL;
cloned_guts->attrib_store = VTABLE_clone(interp, obj->attrib_store);
@@ -330,10 +321,6 @@
}
}
- /* free object attributes if created directly */
- if (!PMC_IS_NULL(dest))
- mem_sys_free(obj);
-
/* And we have ourselves a clone. */
return cloned;
}
@@ -385,10 +372,17 @@
get_pmc_proxy(PARROT_INTERP, INTVAL type)
{
ASSERT_ARGS(get_pmc_proxy)
+ PMC * type_class;
/* Check if not a PMC or invalid type number */
if (type > interp->n_vtable_max || type <= 0)
return PMCNULL;
+
+ type_class = interp->vtables[type]->pmc_class;
+ if (type != enum_class_Class
+ && type_class->vtable->base_type == enum_class_Class) {
+ return type_class;
+ }
else {
PMC * const parrot_hll = Parrot_get_namespace_keyed_str(interp, interp->root_namespace, CONST_STRING(interp, "parrot"));
PMC * const pmc_ns =
@@ -521,12 +515,7 @@
PMC *result =
VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name);
- if (!PMC_IS_NULL(result)) {
- return result;
- }
- else if (VTABLE_exists_keyed_str(interp, _class->parent_overrides, name))
- return PMCNULL;
- else {
+ if (PMC_IS_NULL(result)) {
/* Walk and search for the vtable method. */
const INTVAL num_classes = VTABLE_elements(interp, _class->all_parents);
INTVAL i;
@@ -542,11 +531,13 @@
if (!PMC_IS_NULL(result))
break;
}
-
+ if (PMC_IS_NULL(result))
+ result = pmc_new(interp, enum_class_Undef);
VTABLE_set_pmc_keyed_str(interp, _class->parent_overrides, name, result);
-
- return result;
}
+ if (result->vtable->base_type == enum_class_Undef)
+ result = PMCNULL;
+ return result;
}
Modified: branches/pluggable_runcore/src/ops/set.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/set.ops Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/ops/set.ops Thu Aug 27 18:38:59 2009 (r40830)
@@ -500,8 +500,7 @@
PMC * const meta = VTABLE_getprops(interp, $1);
/* avoid leaks and unreachable memory by destroying the destination PMC */
- if (PObj_active_destroy_TEST($1))
- VTABLE_destroy(interp, $1);
+ Parrot_pmc_destroy(interp, $1);
/* the source PMC knows how to clone itself, but we must reuse the
* destination header */
@@ -509,8 +508,10 @@
/* don't let the clone's destruction destroy the destination's data */
PObj_active_destroy_CLEAR(clone);
- if (PObj_is_PMC_EXT_TEST(clone))
- clone->pmc_ext = NULL;
+ PMC_data(clone) = NULL;
+ PMC_metadata(clone) = NULL;
+ PMC_next_for_GC(clone) = NULL;
+ PMC_sync(clone) = NULL;
/* Restore metadata. */
if (!PMC_IS_NULL(meta)) {
Modified: branches/pluggable_runcore/src/ops/string.ops
==============================================================================
--- branches/pluggable_runcore/src/ops/string.ops Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/ops/string.ops Thu Aug 27 18:38:59 2009 (r40830)
@@ -392,7 +392,7 @@
$1 = PTR2UINTVAL($2->strstart);
break;
case STRINGINFO_BUFLEN:
- $1 = PObj_buflen($2);
+ $1 = Buffer_buflen($2);
break;
case STRINGINFO_FLAGS:
$1 = PObj_get_FLAGS($2);
Modified: branches/pluggable_runcore/src/packdump.c
==============================================================================
--- branches/pluggable_runcore/src/packdump.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/packdump.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -100,7 +100,6 @@
"private7",
"is_string",
"is_PMC",
- "is_PMC_EXT",
"is_shared",
"constant",
"external",
@@ -116,7 +115,6 @@
"report",
"data_is_PMC_array",
"need_finalize",
- "is_special_PMC",
"high_priority_gc",
"needs_early_gc",
"is_class",
Modified: branches/pluggable_runcore/src/pmc.c
==============================================================================
--- branches/pluggable_runcore/src/pmc.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -42,14 +42,6 @@
UINTVAL flags)
__attribute__nonnull__(1);
-static INTVAL pmc_reuse_check_pmc_ext(PARROT_INTERP,
- ARGMOD(PMC * pmc),
- INTVAL newflags,
- INTVAL flags)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- FUNC_MODIFIES(* pmc);
-
PARROT_CANNOT_RETURN_NULL
static PMC* pmc_reuse_no_init(PARROT_INTERP,
ARGIN(PMC *pmc),
@@ -64,9 +56,6 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_get_new_pmc_header __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_pmc_reuse_check_pmc_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(pmc)
#define ASSERT_ARGS_pmc_reuse_no_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(pmc)
@@ -102,6 +91,54 @@
/*
+=item C<void Parrot_pmc_destroy(PARROT_INTERP, PMC *pmc)>
+
+Destroy a PMC. Call his destroy vtable function if needed, and deallocate
+his attributes if they are automatically allocated.
+
+For internal usage of the PMC handling functions and garbage collection
+subsystem.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_pmc_destroy(PARROT_INTERP, ARGIN(PMC *pmc))
+{
+ ASSERT_ARGS(Parrot_pmc_destroy)
+
+ if (PObj_active_destroy_TEST(pmc)) {
+ VTABLE_destroy(interp, pmc);
+ /* Prevent repeated calls. */
+ PObj_active_destroy_CLEAR(pmc);
+ }
+
+ if (pmc->vtable->attr_size) {
+ if (PMC_data(pmc)) {
+#if GC_USE_FIXED_SIZE_ALLOCATOR
+ Parrot_gc_free_pmc_attributes(interp, pmc, pmc->vtable->attr_size);
+#else
+ mem_sys_free(PMC_data(pmc));
+ PMC_data(pmc) = NULL;
+#endif
+ }
+ }
+ else {
+ PMC_data(pmc) = NULL;
+ }
+
+#ifndef NDEBUG
+
+ pmc->vtable = (VTABLE *)0xdeadbeef;
+
+#endif
+
+}
+
+/*
+
=item C<PMC * pmc_new(PARROT_INTERP, INTVAL base_type)>
Creates a new PMC of type C<base_type> (which is an index into the list of PMC
@@ -229,29 +266,17 @@
/* Singleton/const PMCs/types are not eligible */
check_pmc_reuse_flags(interp, pmc->vtable->flags, new_vtable->flags);
- /* Does the old PMC need any resources freed? */
- if (PObj_active_destroy_TEST(pmc))
- VTABLE_destroy(interp, pmc);
-
- new_flags = pmc_reuse_check_pmc_ext(interp, pmc, new_flags, new_vtable->flags);
+ /* Free the old PMC resources. */
+ Parrot_pmc_destroy(interp, pmc);
- /* we are a PMC + maybe is_PMC_EXT */
PObj_flags_SETTO(pmc, PObj_is_PMC_FLAG | new_flags);
/* Set the right vtable */
pmc->vtable = new_vtable;
- if (PMC_data(pmc) && pmc->vtable->attr_size) {
-#if GC_USE_FIXED_SIZE_ALLOCATOR
- Parrot_gc_free_pmc_attributes(interp, pmc, pmc->vtable->attr_size);
-#else
- mem_sys_free(PMC_data(pmc));
-#endif
- }
-
if (new_vtable->attr_size) {
#if GC_USE_FIXED_SIZE_ALLOCATOR
- Parrot_gc_allocate_pmc_attributes(interp, pmc, pmc->vtable->attr_size);
+ Parrot_gc_allocate_pmc_attributes(interp, pmc, new_vtable->attr_size);
#else
PMC_data(pmc) = mem_sys_allocate_zeroed(new_vtable->attr_size);
#endif
@@ -294,19 +319,23 @@
/* Singleton/const PMCs/types are not eligible */
check_pmc_reuse_flags(interp, pmc->vtable->flags, new_vtable->flags);
- /* Does the old PMC need any resources freed? */
- if (PObj_active_destroy_TEST(pmc))
- VTABLE_destroy(interp, pmc);
-
- new_flags = pmc_reuse_check_pmc_ext(interp, pmc,
- new_flags, new_vtable->flags);
+ Parrot_pmc_destroy(interp, pmc);
- /* we are a PMC + maybe is_PMC_EXT */
PObj_flags_SETTO(pmc, PObj_is_PMC_FLAG | new_flags);
/* Set the right vtable */
pmc->vtable = new_vtable;
+ if (new_vtable->attr_size) {
+#if GC_USE_FIXED_SIZE_ALLOCATOR
+ Parrot_gc_allocate_pmc_attributes(interp, pmc, new_vtable->attr_size);
+#else
+ PMC_data(pmc) = mem_sys_allocate_zeroed(new_vtable->attr_size);
+#endif
+}
+ else
+ PMC_data(pmc) = NULL;
+
return pmc;
}
@@ -359,53 +388,6 @@
/*
-=item C<static INTVAL pmc_reuse_check_pmc_ext(PARROT_INTERP, PMC * pmc, INTVAL
-newflags, INTVAL flags)>
-
-We are converting one PMC type into another, such as in C<pmc_reuse> or
-C<pmc_reuse_by_class>. Check to make sure that we have a pmc_ext if we need
-one, and that we don't have it if we don't need it. Returns the updated
-flags field with the C<PObj_is_PMC_EXT> flag set if necessary.
-
-=cut
-
-*/
-
-static INTVAL
-pmc_reuse_check_pmc_ext(PARROT_INTERP, ARGMOD(PMC * pmc),
- INTVAL newflags, INTVAL flags)
-{
- ASSERT_ARGS(pmc_reuse_check_pmc_ext)
- /* Do we have an extension area? */
- INTVAL const has_ext = (PObj_is_PMC_EXT_TEST(pmc) && pmc->pmc_ext);
-
- if (PMC_data(pmc) && pmc->vtable->attr_size) {
-#if GC_USE_FIXED_SIZE_ALLOCATOR
- Parrot_gc_free_pmc_attributes(interp, pmc, pmc->vtable->attr_size);
-#else
- mem_sys_free(PMC_data(pmc));
-#endif
- }
-
- /* Do we need one? */
- if (flags & VTABLE_PMC_NEEDS_EXT) {
- /* If we need an ext area, go allocate one */
- Parrot_gc_add_pmc_ext(interp, pmc);
- newflags |= PObj_is_PMC_EXT_FLAG;
- PARROT_ASSERT((newflags & PObj_is_PMC_EXT_FLAG) != 0);
- }
- else {
- Parrot_gc_free_pmc_ext(interp, pmc);
- PMC_data(pmc) = NULL;
- newflags &= ~PObj_is_PMC_EXT_FLAG;
- PARROT_ASSERT((newflags & PObj_is_PMC_EXT_FLAG) == 0);
- PARROT_ASSERT(pmc->pmc_ext == NULL);
- }
- return newflags;
-}
-
-/*
-
=item C<static PMC * get_new_pmc_header(PARROT_INTERP, INTVAL base_type, UINTVAL
flags)>
@@ -482,11 +464,8 @@
vtable = interp->vtables[base_type];
}
- if (vtable_flags & VTABLE_PMC_NEEDS_EXT) {
- flags |= PObj_is_PMC_EXT_FLAG;
- if (vtable_flags & VTABLE_IS_SHARED_FLAG)
- flags |= PObj_is_PMC_shared_FLAG;
- }
+ if (vtable_flags & VTABLE_IS_SHARED_FLAG)
+ flags |= PObj_is_PMC_shared_FLAG;
pmc = Parrot_gc_new_pmc_header(interp, flags);
pmc->vtable = vtable;
@@ -844,11 +823,10 @@
* original because we have a singleton. Just set the singleton to
* be our class object, but don't mess with its vtable. */
if ((interp->vtables[type]->flags & VTABLE_PMC_IS_SINGLETON)
- && (_class == _class->vtable->pmc_class)) {
+ && (_class == _class->vtable->pmc_class))
interp->vtables[type]->pmc_class = _class;
- }
else {
- Parrot_gc_free_pmc_ext(interp, _class);
+ Parrot_gc_free_pmc_sync(interp, _class);
gc_flag_CLEAR(is_special_PMC, _class);
PObj_is_PMC_shared_CLEAR(_class);
interp->vtables[type]->pmc_class = _class;
Modified: branches/pluggable_runcore/src/pmc/addrregistry.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/addrregistry.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/addrregistry.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2005-2008, Parrot Foundation.
+Copyright (C) 2005-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -29,7 +29,7 @@
#include "parrot/hash.h"
#include "pmc_hash.h"
-pmclass AddrRegistry extends Hash need_ext provides hash {
+pmclass AddrRegistry extends Hash provides hash auto_attrs {
/*
=item C<void init()>
@@ -48,8 +48,8 @@
key_hash_int);
Parrot_AddrRegistry_attributes *attrs =
- mem_allocate_zeroed_typed(Parrot_AddrRegistry_attributes);
- PMC_data(SELF) = attrs;
+ (Parrot_AddrRegistry_attributes *) PMC_data(SELF);
+
SELF.set_pointer(registry);
PObj_custom_mark_destroy_SETALL(SELF);
Modified: branches/pluggable_runcore/src/pmc/array.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/array.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/array.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -98,7 +98,7 @@
}
-pmclass Array need_ext provides array {
+pmclass Array provides array {
/*
Modified: branches/pluggable_runcore/src/pmc/callsignature.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/callsignature.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/callsignature.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -27,7 +27,7 @@
if (!PARROT_CAPTURE(obj)->hash) \
PARROT_CAPTURE(obj)->hash = pmc_new((i), enum_class_Hash);
-pmclass CallSignature extends Capture need_ext auto_attrs provides array provides hash {
+pmclass CallSignature extends Capture auto_attrs provides array provides hash {
ATTR PMC *returns; /* Result PMCs, if they were passed with the call */
ATTR PMC *type_tuple; /* Cached argument types for multiple dispatch */
ATTR STRING *short_sig; /* Simple string signature args & returns */
Modified: branches/pluggable_runcore/src/pmc/capture.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/capture.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/capture.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -26,7 +26,7 @@
if (!PARROT_CAPTURE(obj)->hash) \
PARROT_CAPTURE(obj)->hash = pmc_new((i), enum_class_Hash);
-pmclass Capture need_ext auto_attrs {
+pmclass Capture auto_attrs {
ATTR PMC *array;
ATTR PMC *hash;
ATTR INTVAL data_size;
Modified: branches/pluggable_runcore/src/pmc/class.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/class.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/class.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -94,6 +94,43 @@
#include "pmc_object.h"
#include "pmc_namespace.h"
+static int
+cache_class_attribs(PARROT_INTERP, PMC *cur_class, PMC *attrib_index,
+ PMC *cache, int cur_index)
+{
+ /* The attribute metadata hash. */
+ Parrot_Class_attributes * const class_info = PARROT_CLASS(cur_class);
+ PMC * const attribs = class_info->attrib_metadata;
+ PMC * const iter = VTABLE_get_iter(interp, attribs);
+
+ /* Build a string representing the fully qualified class name. */
+ /* Retrieve the fully qualified class name for the class. */
+ STRING * const fq_class = VTABLE_get_string(interp, cur_class);
+ PMC * const class_cache = pmc_new(interp, enum_class_Hash);
+ VTABLE_set_pmc_keyed_str(interp, cache, fq_class, class_cache);
+
+ /* Iterate over the attributes. */
+ while (VTABLE_get_bool(interp, iter)) {
+ /* Get attribute. */
+ PMC * const cur_attrib = VTABLE_get_pmc_keyed_str(interp,
+ attribs, VTABLE_shift_string(interp, iter));
+
+ /* Get attribute name and append it to the key. */
+ STRING * const name_str = CONST_STRING(interp, "name");
+ STRING * const attrib_name = VTABLE_get_string_keyed_str(
+ interp, cur_attrib, name_str);
+
+ STRING * const full_key = Parrot_str_append(interp, fq_class, attrib_name);
+
+ /* Insert into hash, along with index. */
+ VTABLE_set_integer_keyed_str(interp, attrib_index, full_key, cur_index);
+ VTABLE_set_integer_keyed_str(interp, class_cache, attrib_name, cur_index);
+ cur_index++;
+ }
+
+ return cur_index;
+}
+
/* This function builds the attribute index (table to map class name and
* attribute name to an index) for the current class. */
static void
@@ -106,7 +143,7 @@
const int num_classes = VTABLE_elements(interp, _class->all_parents);
int i;
- /* We will go over the list of all parents to construct the attribute index. */
+ /* Go over the list of all parents to construct the attribute index. */
for (i = 0; i < num_classes; i++) {
/* Get the class and check that it respects the standard class interface
* (if not we don't know how it stores its attributes, so we'll have to
@@ -114,44 +151,15 @@
PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp,
_class->all_parents, i);
- if (PObj_is_class_TEST(cur_class)) {
- /* The attribute metadata hash. */
- Parrot_Class_attributes * const class_info = PARROT_CLASS(cur_class);
- PMC * const attribs = class_info->attrib_metadata;
- PMC * const iter = VTABLE_get_iter(interp, attribs);
-
- /* Build a string representing the fully qualified class name. */
- /* Retrieve the fully qualified class name for the class. */
- STRING * const fq_class = VTABLE_get_string(interp, cur_class);
- PMC * const class_cache = pmc_new(interp, enum_class_Hash);
- VTABLE_set_pmc_keyed_str(interp, cache, fq_class, class_cache);
-
- /* Iterate over the attributes. */
- while (VTABLE_get_bool(interp, iter)) {
- /* Get attribute. */
- PMC * const cur_attrib = VTABLE_get_pmc_keyed_str(interp,
- attribs, VTABLE_shift_string(interp, iter));
-
- /* Get attribute name and append it to the key. */
- STRING * const name_str = CONST_STRING(interp, "name");
- STRING * const attrib_name = VTABLE_get_string_keyed_str(
- interp, cur_attrib, name_str);
-
- STRING * const full_key = Parrot_str_append(interp, fq_class, attrib_name);
-
- /* Insert into hash, along with index. */
- VTABLE_set_integer_keyed_str(interp, attrib_index, full_key, cur_index);
- VTABLE_set_integer_keyed_str(interp, class_cache, attrib_name, cur_index);
- cur_index++;
- }
- }
+ if (PObj_is_class_TEST(cur_class))
+ cur_index = cache_class_attribs(interp, cur_class,
+ attrib_index, cache, cur_index);
}
/* Store built attribute index and invalidate cache. */
_class->attrib_index = attrib_index;
_class->attrib_cache = cache;
}
-
/* Takes a hash and initializes the class based on it. */
static void
init_class_from_hash(PARROT_INTERP, PMC *self, PMC *info)
@@ -442,8 +450,7 @@
*/
-pmclass Class
- need_ext auto_attrs {
+pmclass Class auto_attrs {
ATTR INTVAL id; /* The type number of the PMC. [deprecated: See RT #48024] */
ATTR STRING *name; /* The name of the class. */
@@ -969,7 +976,13 @@
/* What should we return? */
PMC *found;
- if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) {
+ if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attributes"))) {
+ found = _class->attrib_metadata;
+ }
+ else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "parents"))) {
+ found = _class->parents;
+ }
+ else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) {
found = pmc_new(interp, enum_class_String);
VTABLE_set_string_native(interp, found, _class->name);
}
@@ -981,9 +994,6 @@
/* Should not clone this. */
return _class->_namespace;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attributes"))) {
- found = _class->attrib_metadata;
- }
else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "attrib_index"))) {
found = _class->attrib_index;
}
@@ -993,9 +1003,6 @@
else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "vtable_overrides"))) {
found = _class->vtable_overrides;
}
- else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "parents"))) {
- found = _class->parents;
- }
else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "all_parents"))) {
found = _class->all_parents;
}
@@ -1222,9 +1229,14 @@
/* Initialize the object's underlying structure, pointing it to this
* class. */
- PMC_data(object) =
- (Parrot_Object_attributes *)Parrot_oo_new_object_attrs(interp, SELF);
-
+ /* TODO: this has been changed in order to use auto_attrs in the
+ * Object PMC. Needs to be redone in a cleaner way. */
+ {
+ Parrot_Object_attributes * const objattr =
+ (Parrot_Object_attributes *)PMC_data(object);
+ objattr->_class = SELF;
+ objattr->attrib_store = pmc_new(interp, enum_class_ResizablePMCArray);
+ }
if (!PMC_IS_NULL(init)) {
/* Initialize attributes with the supplied values. */
PMC * const iter = VTABLE_get_iter(interp, init);
@@ -1280,21 +1292,6 @@
/* Check if the class object is the same as self's class object */
if (VTABLE_is_same(interp, SELF, classobj))
return 1;
- else {
- STRING * const classname = VTABLE_get_string(interp, classobj);
- const INTVAL is_proxy = (SELF->vtable->base_type == enum_class_PMCProxy);
-
- /* avoid the expensive string copy, if possible */
- STRING * const self_name = is_proxy
- ? VTABLE_get_string(interp, SELF)
- : make_class_name(interp, SELF);
-
- /* Check if the passed name is the same as the stored short name. */
- const INTVAL name_match = Parrot_str_equal(interp, classname, self_name);
-
- if (name_match)
- return 1;
- }
/* Iterate over all the parents and check if they respond true
* for 'isa' on the original comparison. */
Modified: branches/pluggable_runcore/src/pmc/complex.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/complex.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/complex.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -217,7 +217,7 @@
}
-pmclass Complex need_ext auto_attrs {
+pmclass Complex auto_attrs {
ATTR FLOATVAL re; /* real part */
ATTR FLOATVAL im; /* imaginary part */
Modified: branches/pluggable_runcore/src/pmc/continuation.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/continuation.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/continuation.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -42,10 +42,10 @@
* context a pointer to the register frame, which contains active objects.
* Additionally ct->current_cont has the continuation of the caller.
* To avoid deep recursion during marking of nested subroutines, we
- * need the next_for_GC pointer in the pmc_ext area.
+ * need the next_for_GC pointer.
*/
-pmclass Continuation need_ext auto_attrs {
+pmclass Continuation auto_attrs {
ATTR struct Parrot_cont *cont; /* the continuation struct */
/*
Modified: branches/pluggable_runcore/src/pmc/coroutine.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/coroutine.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/coroutine.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -56,7 +56,7 @@
print_pbc_location(interp);
}
-pmclass Coroutine extends Sub need_ext {
+pmclass Coroutine extends Sub auto_attrs {
ATTR PackFile_ByteCode *caller_seg; /* bytecode segment */
ATTR opcode_t *address; /* next address to run - toggled each time */
@@ -76,11 +76,10 @@
VTABLE void init() {
Parrot_Coroutine_attributes *attrs =
- mem_allocate_zeroed_typed(Parrot_Coroutine_attributes);
+ (Parrot_Coroutine_attributes *) PMC_data(SELF);
attrs->seg = INTERP->code;
attrs->ctx = NULL;
- PMC_data(SELF) = attrs;
PObj_custom_mark_destroy_SETALL(SELF);
}
Modified: branches/pluggable_runcore/src/pmc/cpointer.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/cpointer.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/cpointer.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -46,7 +46,7 @@
*/
-pmclass CPointer need_ext auto_attrs {
+pmclass CPointer auto_attrs {
ATTR void *pointer; /* The stored pointer. */
ATTR STRING *sig; /* A string signature for the pointer. */
Modified: branches/pluggable_runcore/src/pmc/default.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/default.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/default.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -230,9 +230,6 @@
make_prop_hash(PARROT_INTERP, PMC *self) {
PMC *prop;
- if (!self->pmc_ext)
- Parrot_gc_add_pmc_ext(interp, self);
-
PMC_metadata(self) = prop = pmc_new(interp, enum_class_Hash);
GC_WRITE_BARRIER(interp, self, NULL, prop);
propagate_std_props(interp, self, prop);
@@ -390,7 +387,7 @@
*/
VTABLE PMC *getprop(STRING *key) {
- if (SELF->pmc_ext && PMC_metadata(SELF))
+ if (PMC_metadata(SELF))
return VTABLE_get_pmc_keyed_str(INTERP, PMC_metadata(SELF), key);
else
return check_get_std_props(interp, SELF, key);
@@ -410,10 +407,8 @@
if (check_set_std_props(INTERP, SELF, key, value))
return;
- if (SELF->pmc_ext && PMC_metadata(SELF)) {
- VTABLE_set_pmc_keyed_str(INTERP,
- PMC_metadata(SELF), key, value);
- }
+ if (PMC_metadata(SELF))
+ VTABLE_set_pmc_keyed_str(INTERP, PMC_metadata(SELF), key, value);
else {
PMC * const prop = make_prop_hash(INTERP, SELF);
@@ -432,7 +427,7 @@
*/
VTABLE void delprop(STRING *key) {
- if (SELF->pmc_ext && PMC_metadata(SELF))
+ if (PMC_metadata(SELF))
VTABLE_delete_keyed_str(INTERP, PMC_metadata(SELF), key);
}
@@ -447,9 +442,6 @@
*/
VTABLE PMC *getprops() {
- if (!SELF->pmc_ext)
- Parrot_gc_add_pmc_ext(INTERP, SELF);
-
if (!PMC_metadata(SELF)) {
if (has_pending_std_props(SELF))
return make_prop_hash(INTERP, SELF);
@@ -1068,7 +1060,7 @@
VTABLE void visit(visit_info *info) {
/* default - mark prop hash */
- if (SELF->pmc_ext && PMC_metadata(SELF) &&
+ if (PMC_metadata(SELF) &&
info->extra_flags != EXTRA_IS_PROP_HASH) {
info->extra_flags = EXTRA_IS_PROP_HASH;
info->extra = PMC_metadata(SELF);
@@ -1123,9 +1115,6 @@
VTABLE void thaw(visit_info *info) {
/* default - initialize the PMC */
if (info->extra_flags == EXTRA_IS_PROP_HASH) {
- if (!SELF->pmc_ext)
- Parrot_gc_add_pmc_ext(INTERP, SELF);
-
info->thaw_ptr = &PMC_metadata(SELF);
info->container = SELF;
Modified: branches/pluggable_runcore/src/pmc/eval.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/eval.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/eval.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -125,7 +125,7 @@
}
}
-pmclass Eval extends Sub need_ext {
+pmclass Eval extends Sub auto_attrs {
VTABLE void init() {
Parrot_Sub_attributes *sub_data;
Modified: branches/pluggable_runcore/src/pmc/eventhandler.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/eventhandler.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/eventhandler.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,7 @@
*/
-pmclass EventHandler extends Sub need_ext {
+pmclass EventHandler extends Sub auto_attrs {
ATTR STRING *type; /* the type of the event to handle */
ATTR PMC *code; /* the code object to execute */
@@ -38,13 +38,8 @@
*/
VTABLE void init() {
- Parrot_EventHandler_attributes *e =
- mem_allocate_zeroed_typed(Parrot_EventHandler_attributes);
-
PObj_custom_mark_SET(SELF);
PObj_active_destroy_SET(SELF);
-
- PMC_data(SELF) = e;
}
/*
@@ -84,7 +79,8 @@
PMC *interpreter = PMCNULL;
STRING *type = NULL;
INTVAL priority = 0;
- Parrot_EventHandler_attributes *e = NULL;
+ Parrot_EventHandler_attributes *e =
+ (Parrot_EventHandler_attributes *) PMC_data(SELF);
if (VTABLE_isa(INTERP, data, CONST_STRING(INTERP, "Sub"))) {
code = data;
@@ -104,12 +100,9 @@
interpreter = VTABLE_get_pmc_keyed_int(INTERP,
INTERP->iglobals, IGLOBALS_INTERPRETER);
- e = mem_allocate_zeroed_typed(Parrot_EventHandler_attributes);
-
PObj_custom_mark_SET(SELF);
PObj_active_destroy_SET(SELF);
- PMC_data(SELF) = e;
e->type = type;
e->code = code;
e->interp = interpreter;
Modified: branches/pluggable_runcore/src/pmc/exception.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/exception.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/exception.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -659,7 +659,8 @@
else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "thrower"))) {
/* Ensure it's a ret cont, and extract the from_ctx.
* XXX TT#596 - when we have Context PMCs, just take and set that. */
- if (VTABLE_isa(interp, value, CONST_STRING(interp, "Continuation"))) {
+
+ if (!PMC_IS_NULL(value) && VTABLE_isa(interp, value, CONST_STRING(interp, "Continuation"))) {
Parrot_Context *ctx = PMC_cont(value)->from_ctx;
if (ctx) {
Parrot_context_ref(interp, ctx);
Modified: branches/pluggable_runcore/src/pmc/exceptionhandler.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/exceptionhandler.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/exceptionhandler.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -22,7 +22,7 @@
#include "parrot/oplib/ops.h"
-pmclass ExceptionHandler extends Continuation need_ext auto_attrs {
+pmclass ExceptionHandler extends Continuation auto_attrs {
ATTR PMC *handled_types;
ATTR PMC *handled_types_except;
Modified: branches/pluggable_runcore/src/pmc/exporter.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/exporter.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/exporter.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -90,7 +90,7 @@
*/
-pmclass Exporter need_ext auto_attrs {
+pmclass Exporter auto_attrs {
ATTR PMC *ns_src;
ATTR PMC *ns_dest;
Modified: branches/pluggable_runcore/src/pmc/filehandle.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/filehandle.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/filehandle.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -659,9 +659,11 @@
METHOD get_fd() {
#ifndef PIO_OS_STDIO
- INTVAL os_handle;
+ PIOHANDLE os_handle;
+ INTVAL fd;
GET_ATTR_os_handle(INTERP, SELF, os_handle);
- RETURN(INTVAL os_handle);
+ fd = (INTVAL)os_handle;
+ RETURN(INTVAL fd);
#endif /*PIO_OS_STDIO*/
RETURN(INTVAL -1);
Modified: branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/fixedbooleanarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -23,7 +23,7 @@
#define BITS_PER_CHAR 8
-pmclass FixedBooleanArray need_ext auto_attrs provides array {
+pmclass FixedBooleanArray auto_attrs provides array {
ATTR UINTVAL size; /* # of bits this fba holds */
ATTR UINTVAL resize_threshold; /* max capacity before resizing */
ATTR unsigned char * bit_array; /* where the bits go */
Modified: branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/fixedfloatarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,7 @@
*/
-pmclass FixedFloatArray need_ext auto_attrs provides array {
+pmclass FixedFloatArray auto_attrs provides array {
ATTR INTVAL size;
ATTR FLOATVAL *float_array;
@@ -31,19 +31,6 @@
=over 4
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-
- VTABLE void init() {
- }
-
-/*
-
=item C<void destroy()>
Destroys the array.
Modified: branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/fixedintegerarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,7 @@
*/
-pmclass FixedIntegerArray need_ext auto_attrs provides array {
+pmclass FixedIntegerArray auto_attrs provides array {
ATTR INTVAL size; /* number of INTVALs stored in this array */
ATTR INTVAL * int_array; /* INTVALs are stored here */
Modified: branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/fixedpmcarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -27,7 +27,7 @@
#define PMC_size(x) ((Parrot_FixedPMCArray_attributes *)PMC_data(x))->size
#define PMC_array(x) ((Parrot_FixedPMCArray_attributes *)PMC_data(x))->pmc_array
-pmclass FixedPMCArray need_ext auto_attrs provides array {
+pmclass FixedPMCArray auto_attrs provides array {
ATTR INTVAL size; /* number of elements in the array */
ATTR PMC **pmc_array; /* pointer to PMC array */
Modified: branches/pluggable_runcore/src/pmc/fixedstringarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/fixedstringarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/fixedstringarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,7 @@
*/
-pmclass FixedStringArray need_ext auto_attrs provides array {
+pmclass FixedStringArray auto_attrs provides array {
ATTR STRING **str_array; /* where the STRINGs are stored */
ATTR UINTVAL size; /* element count */
Modified: branches/pluggable_runcore/src/pmc/hash.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/hash.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/hash.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -376,7 +376,7 @@
/* Needs ext struct for the next_for_GC pointer
* We would get recursive marking of a deeply nested HoHoH...
*/
-pmclass Hash need_ext provides hash {
+pmclass Hash provides hash auto_attrs {
ATTR Hash *hash;
/*
@@ -395,9 +395,8 @@
VTABLE void init() {
Parrot_Hash_attributes * const attr =
- mem_allocate_typed(Parrot_Hash_attributes);
+ (Parrot_Hash_attributes *) PMC_data(SELF);
- PMC_data(SELF) = attr;
attr->hash = parrot_new_hash(INTERP);
attr->hash->container = SELF;
PObj_custom_mark_destroy_SETALL(SELF);
@@ -407,9 +406,6 @@
Hash * const hash = (Hash *)SELF.get_pointer();
if (hash)
parrot_hash_destroy(INTERP, hash);
-
- mem_sys_free(PMC_data(SELF));
- PMC_data(SELF) = NULL;
}
/*
Modified: branches/pluggable_runcore/src/pmc/hashiterator.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/hashiterator.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/hashiterator.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -246,8 +246,10 @@
*/
VTABLE STRING* shift_string() {
- PMC * const key = SELF.shift_pmc();
- return VTABLE_get_string(INTERP, key);
+ PMC * const key = SELF.shift_pmc();
+ STRING * const ret = VTABLE_get_string(INTERP, key);
+ temporary_pmc_free(INTERP, key);
+ return ret;
}
}
Modified: branches/pluggable_runcore/src/pmc/integer.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/integer.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/integer.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -55,10 +55,6 @@
Initializes the integer with a default value of C<0>.
-=item C<void destroy()>
-
-Destroys this PMC.
-
=cut
*/
@@ -94,10 +90,6 @@
(Parrot_Integer_attributes *)PMC_data(SELF);
attrs->iv = 0;
- PObj_active_destroy_SET(SELF);
- }
-
- VTABLE void destroy() {
}
/*
Modified: branches/pluggable_runcore/src/pmc/key.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/key.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/key.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -18,7 +18,7 @@
*/
-pmclass Key need_ext auto_attrs {
+pmclass Key auto_attrs {
ATTR PMC *next_key; /* Sometimes it's the next key, sometimes it's
not. The Key code is like that. */
ATTR INTVAL int_key; /* int value of this key, or something magical if
@@ -257,9 +257,6 @@
VTABLE PMC *shift_pmc() {
PMC *next_key;
- if (!SELF->pmc_ext)
- return NULL;
-
GET_ATTR_next_key(INTERP, SELF, next_key);
return next_key;
}
Modified: branches/pluggable_runcore/src/pmc/lexinfo.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/lexinfo.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/lexinfo.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2008, Parrot Foundation.
+Copyright (C) 2008-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -23,11 +23,10 @@
/*
* LexInfo contains a constant Hash with constant string
- * keys and integer indices - no marking and no pmc_ext
- * needed (except for freeze/thaw
+ * keys and integer indices
*/
-pmclass LexInfo extends Hash need_ext provides hash no_ro {
+pmclass LexInfo extends Hash provides hash no_ro auto_attrs {
/*
@@ -61,7 +60,8 @@
VTABLE void init_pmc(PMC *sub) {
Hash *hash;
Parrot_LexInfo_attributes *attrs =
- mem_allocate_zeroed_typed(Parrot_LexInfo_attributes);
+ (Parrot_LexInfo_attributes *) PMC_data(SELF);
+
PARROT_ASSERT(PObj_constant_TEST(SELF));
hash = parrot_create_hash(INTERP,
@@ -70,7 +70,6 @@
(hash_comp_fn)Parrot_str_not_equal, /* STRING compare */
(hash_hash_key_fn)Parrot_str_to_hashval); /* hash */
- PMC_data(SELF) = attrs;
SELF.set_pointer(hash);
PObj_active_destroy_SET(SELF);
}
Modified: branches/pluggable_runcore/src/pmc/managedstruct.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/managedstruct.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/managedstruct.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -22,7 +22,7 @@
typedef void (*custom_free_func_t)(PARROT_INTERP, void *ptr, void *priv);
typedef PMC * (*custom_clone_func_t)(PARROT_INTERP, PMC *ptr, void *priv);
-pmclass ManagedStruct extends UnManagedStruct need_ext auto_attrs {
+pmclass ManagedStruct extends UnManagedStruct auto_attrs {
/* if custom_free_func and ptr (inherited from UnManagedStruct) are both set,
* custom_free_func is called before the normal destroy() function does any
* work.
Modified: branches/pluggable_runcore/src/pmc/multisub.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/multisub.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/multisub.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,7 @@
*/
-pmclass MultiSub extends ResizablePMCArray need_ext auto_attrs provides array {
+pmclass MultiSub extends ResizablePMCArray auto_attrs provides array {
VTABLE void push_pmc(PMC *value) {
STRING * const _sub = CONST_STRING(interp, "Sub");
Modified: branches/pluggable_runcore/src/pmc/namespace.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/namespace.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/namespace.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -123,7 +123,7 @@
#define FPA_is_ns_ext PObj_private0_FLAG
-pmclass NameSpace extends Hash provides hash need_ext no_ro {
+pmclass NameSpace extends Hash provides hash no_ro auto_attrs {
ATTR STRING *name; /* Name of this namespace part. */
ATTR PMC *_class; /* The class or role attached to this namespace. */
@@ -144,8 +144,6 @@
*/
VTABLE void init() {
- PMC_data(SELF) =
- mem_allocate_zeroed_typed(Parrot_NameSpace_attributes);
PARROT_NAMESPACE(SELF)->vtable = PMCNULL;
PARROT_NAMESPACE(SELF)->_class = PMCNULL;
SELF.set_pointer(parrot_new_hash(INTERP));
@@ -178,20 +176,6 @@
/*
-=item C<void destroy()>
-
-Frees the namespace info struct.
-
-=cut
-
-*/
- VTABLE void destroy() {
- /* Call Hash.destroy. It will free all memory. */
- SUPER();
- }
-
-/*
-
=item C<PMC *get_class()>
Returns the class or role PMC that is associated with this namespace.
Modified: branches/pluggable_runcore/src/pmc/nci.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/nci.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/nci.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
$Id$
=head1 NAME
@@ -100,8 +100,30 @@
mem_sys_free(param_sig);
}
+/* actually build the NCI thunk */
+static nci_sub_t build_func(PARROT_INTERP, PMC *, Parrot_NCI_attributes *);
-pmclass NCI need_ext auto_attrs {
+static
+nci_sub_t build_func(PARROT_INTERP, PMC *pmc, Parrot_NCI_attributes *nci_info)
+{
+ STRING *key = nci_info->signature;
+ size_t key_length = Parrot_str_byte_length(interp, key);
+ int jitted = 0;
+
+ pcc_params(interp, key, nci_info, key_length);
+
+ /* Arity is length of that string minus one (the return type). */
+ nci_info->arity = key_length - 1;
+
+ /* Build call function. */
+ nci_info->func = (PMC *)(build_call_func(interp, pmc, key, &jitted));
+ nci_info->jitted = jitted;
+
+ return (nci_sub_t)nci_info->func;
+}
+
+
+pmclass NCI auto_attrs {
ATTR STRING *signature; /* The signature. */
ATTR void *func; /* Function pointer to call. */
ATTR void *orig_func; /* Function pointer
@@ -181,30 +203,20 @@
VTABLE void set_pointer_keyed_str(STRING *key, void *func) {
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
- int jitted = 0;
- size_t key_length = Parrot_str_byte_length(interp, key);
/* Store the original function and signature. */
SET_ATTR_orig_func(INTERP, SELF, func);
/* ensure that the STRING signature is constant */
if (!PObj_constant_TEST(key)) {
- char * const key_c = Parrot_str_to_cstring(INTERP, key);
- key = string_make(interp, key_c, key_length,
- NULL, PObj_constant_FLAG);
+ char * const key_c = Parrot_str_to_cstring(INTERP, key);
+ size_t key_length = Parrot_str_byte_length(interp, key);
+ key = string_make(interp, key_c, key_length,
+ NULL, PObj_constant_FLAG);
Parrot_str_free_cstring(key_c);
}
- nci_info->signature = key;
- pcc_params(INTERP, key, nci_info, key_length);
-
- /* Arity is length of that string minus one (the return type). */
- nci_info->arity = key_length - 1;
-
- /* Build call function. */
- nci_info->func = (PMC *)(build_call_func(INTERP, SELF,
- key, &jitted));
- nci_info->jitted = jitted;
+ nci_info->signature = key;
}
/*
@@ -273,23 +285,21 @@
VTABLE INTVAL defined() {
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
- return nci_info->func != NULL;
+ return nci_info->orig_func != NULL;
}
/*
=item C<opcode_t *invoke(void *next)>
-Calls the associated C function, returning C<*next>. If
-the invocant is a class, the PMC arguments are
-shifted down.
+Calls the associated C function, returning C<*next>. If the invocant is a
+class, the PMC arguments are shifted down.
=cut
*/
VTABLE opcode_t *invoke(void *next) {
-
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
nci_sub_t func;
void *orig_func;
@@ -300,12 +310,17 @@
? (nci_sub_t) D2FPTR(orig_func)
: (nci_sub_t) D2FPTR(nci_info->func);
- if (!func)
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "attempt to call NULL function");
+ if (!func) {
+ /* build the thunk only when necessary */
+ func = build_func(interp, SELF, nci_info);
+
+ if (!func)
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
+ EXCEPTION_INVALID_OPERATION,
+ "attempt to call NULL function");
+ }
if (nci_info->jitted) {
-
nci_jit_sub_t jit_func = (nci_jit_sub_t) D2FPTR(nci_info->func);
/* Parrot_eprintf(interp, "JITTED %S\n", nci_info->signature); */
@@ -329,8 +344,8 @@
* return continuation here, which gets rid of this frame
* and returns the real return address
*/
- if (cont && cont != NEED_CONTINUATION &&
- (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) {
+ if (cont && cont != NEED_CONTINUATION
+ && (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) {
cont = CONTEXT(interp)->current_cont;
next = VTABLE_invoke(INTERP, cont, next);
}
@@ -350,6 +365,8 @@
VTABLE INTVAL get_integer() {
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
+ if (!nci_info->func)
+ build_func(INTERP, SELF, nci_info);
return (INTVAL)nci_info->func;
}
@@ -365,7 +382,7 @@
VTABLE INTVAL get_bool() {
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
- return (0 != (INTVAL)nci_info->func);
+ return (0 != (INTVAL)nci_info->orig_func);
}
/*
@@ -381,14 +398,18 @@
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
INTVAL arity = 0;
- if (nci_info && nci_info->func)
- arity = nci_info->arity;
- else
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "You cannot get the arity of an undefined NCI.");
+ if (nci_info) {
+ if (!nci_info->func)
+ build_func(INTERP, SELF, nci_info);
+ if (nci_info->func) {
+ arity = nci_info->arity;
+ RETURN(INTVAL arity);
+ }
+ }
- RETURN(INTVAL arity);
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
+ EXCEPTION_INVALID_OPERATION,
+ "You cannot get the arity of an undefined NCI.");
}
}
Modified: branches/pluggable_runcore/src/pmc/object.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/object.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/object.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -107,7 +107,7 @@
return -1;
}
-pmclass Object need_ext {
+pmclass Object auto_attrs {
ATTR PMC *_class; /* The class this is an instance of. */
ATTR PMC *attrib_store; /* The attributes store - a resizable PMC array. */
@@ -146,14 +146,12 @@
=item C<void destroy()>
-Free the object's underlying struct.
+Just to avoid the automatic generation of one.
=cut
*/
VTABLE void destroy() {
- mem_sys_free(PMC_data(SELF));
- PMC_data(SELF) = NULL;
}
/*
@@ -644,26 +642,16 @@
*/
VTABLE PMC * clone() {
- Parrot_Object_attributes * const obj = PARROT_OBJECT(pmc);
- Parrot_Class_attributes * const _class = PARROT_CLASS(obj->_class);
- STRING * const meth_name = CONST_STRING(interp, "clone");
-
- /* See if we have a custom override of the method first. */
- const int num_classes = VTABLE_elements(interp, _class->all_parents);
- int i;
- for (i = 0; i < num_classes; i++) {
- /* Get the class. */
- PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
-
- /* Look for a method and run it if we find one. */
- PMC * const meth =
- Parrot_oo_find_vtable_override_for_class(interp, cur_class, meth_name);
- if (!PMC_IS_NULL(meth))
- return (PMC*)Parrot_run_meth_fromc_args(interp, meth, pmc, meth_name, "P");
- }
-
- /* If we get here, no custom clone. Create a new object PMC. */
- return Parrot_oo_clone_object(interp, SELF, obj->_class, NULL);
+ Parrot_Object_attributes * const obj = PARROT_OBJECT(pmc);
+ /* If we have a custom override, invoke it.
+ * If not, use the oo function. */
+ STRING * const meth_name = CONST_STRING(interp, "clone");
+ PMC * const meth =
+ Parrot_oo_find_vtable_override(interp, obj->_class, meth_name);
+ if (!PMC_IS_NULL(meth))
+ return (PMC*)Parrot_run_meth_fromc_args(interp, meth, pmc, meth_name, "P");
+ else
+ return Parrot_oo_clone_object(interp, SELF, obj->_class, NULL);
}
/*
Modified: branches/pluggable_runcore/src/pmc/orderedhash.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/orderedhash.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/orderedhash.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -39,7 +39,7 @@
*/
-pmclass OrderedHash extends Hash need_ext provides array provides hash {
+pmclass OrderedHash extends Hash provides array provides hash {
/*
Modified: branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/parrotinterpreter.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -186,7 +186,7 @@
return ret;
}
-pmclass ParrotInterpreter need_ext no_ro {
+pmclass ParrotInterpreter no_ro {
ATTR struct parrot_interp_t *interp; /* this PMC's interpreter */
ATTR INTVAL tid; /* thread id */
ATTR PMC *args; /* args passed to this thread */
Modified: branches/pluggable_runcore/src/pmc/parrotlibrary.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/parrotlibrary.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/parrotlibrary.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -31,7 +31,7 @@
#define PMC_dlhandle(x) ((Parrot_ParrotLibrary_attributes*)PMC_data(x))->dl_handle
#define PMC_oplib_init(x) ((Parrot_ParrotLibrary_attributes*)PMC_data(x))->oplib_init
-pmclass ParrotLibrary need_ext auto_attrs provides library {
+pmclass ParrotLibrary auto_attrs provides library {
ATTR void * dl_handle; /* DLL handle */
ATTR void * oplib_init; /* oplib init function */
Modified: branches/pluggable_runcore/src/pmc/parrotthread.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/parrotthread.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/parrotthread.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -82,7 +82,7 @@
}
-pmclass ParrotThread extends ParrotInterpreter need_ext no_ro {
+pmclass ParrotThread extends ParrotInterpreter no_ro {
/*
Modified: branches/pluggable_runcore/src/pmc/pccmethod_test.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/pccmethod_test.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/pccmethod_test.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -10,7 +10,7 @@
*/
-pmclass PCCMETHOD_Test need_ext provides hash {
+pmclass PCCMETHOD_Test provides hash {
METHOD test_method()
Modified: branches/pluggable_runcore/src/pmc/pmcproxy.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/pmcproxy.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/pmcproxy.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -64,7 +64,7 @@
*/
-pmclass PMCProxy extends Class need_ext auto_attrs {
+pmclass PMCProxy extends Class auto_attrs {
/*
Modified: branches/pluggable_runcore/src/pmc/pointer.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/pointer.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/pointer.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -20,7 +20,7 @@
*/
-pmclass Pointer need_ext auto_attrs {
+pmclass Pointer auto_attrs {
ATTR void * mark_function;
ATTR void * pointer;
Modified: branches/pluggable_runcore/src/pmc/resizablebooleanarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/resizablebooleanarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/resizablebooleanarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -30,7 +30,7 @@
/* Convert a size in bits to a size in bytes */
#define BITS_TO_BYTES(size) ((size) / BITS_PER_CHAR)
-pmclass ResizableBooleanArray extends FixedBooleanArray need_ext auto_attrs provides array {
+pmclass ResizableBooleanArray extends FixedBooleanArray auto_attrs provides array {
/* RBA uses the same attributes as FBA, but in RBA they're used as follows:
size: position of the last element (a.k.a tail_pos)
resize_threshold: position of the first element (a.k.a. head_pos) */
Modified: branches/pluggable_runcore/src/pmc/resizablefloatarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/resizablefloatarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/resizablefloatarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -20,7 +20,7 @@
*/
-pmclass ResizableFloatArray extends FixedFloatArray need_ext auto_attrs provides array {
+pmclass ResizableFloatArray extends FixedFloatArray auto_attrs provides array {
ATTR INTVAL resize_threshold; /* max size before array needs resizing */
/*
Modified: branches/pluggable_runcore/src/pmc/resizableintegerarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/resizableintegerarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/resizableintegerarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -20,7 +20,7 @@
*/
-pmclass ResizableIntegerArray extends FixedIntegerArray need_ext auto_attrs provides array {
+pmclass ResizableIntegerArray extends FixedIntegerArray auto_attrs provides array {
ATTR INTVAL resize_threshold; /* max size before array needs to be resized */
/*
Modified: branches/pluggable_runcore/src/pmc/resizablepmcarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/resizablepmcarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/resizablepmcarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -23,7 +23,7 @@
#define PMC_array(x) ((Parrot_ResizablePMCArray_attributes *)PMC_data(x))->pmc_array
#define PMC_threshold(x) ((Parrot_ResizablePMCArray_attributes *)PMC_data(x))->resize_threshold
-pmclass ResizablePMCArray extends FixedPMCArray need_ext auto_attrs provides array {
+pmclass ResizablePMCArray extends FixedPMCArray auto_attrs provides array {
ATTR INTVAL resize_threshold; /* max size before array needs resizing */
Modified: branches/pluggable_runcore/src/pmc/resizablestringarray.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/resizablestringarray.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/resizablestringarray.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -18,7 +18,7 @@
*/
-pmclass ResizableStringArray extends FixedStringArray need_ext auto_attrs provides array {
+pmclass ResizableStringArray extends FixedStringArray auto_attrs provides array {
ATTR UINTVAL resize_threshold; /*max capacity before resizing */
/*
Modified: branches/pluggable_runcore/src/pmc/retcontinuation.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/retcontinuation.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/retcontinuation.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -23,7 +23,7 @@
#include "parrot/oplib/ops.h"
-pmclass RetContinuation extends Continuation need_ext auto_attrs {
+pmclass RetContinuation extends Continuation auto_attrs {
/*
Modified: branches/pluggable_runcore/src/pmc/role.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/role.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/role.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -198,7 +198,7 @@
*/
-pmclass Role need_ext auto_attrs {
+pmclass Role auto_attrs {
ATTR STRING *name; /* The name of the role. */
ATTR PMC *_namespace; /* The namespace it's linked to, if any. */
ATTR PMC *roles; /* Roles from which this role is composed. */
Modified: branches/pluggable_runcore/src/pmc/scalar.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/scalar.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/scalar.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -1374,7 +1374,7 @@
/* first set readonly */
VTABLE_setprop(INTERP, ret, CONST_STRING(INTERP, "_ro"), _true);
- /* now share; we add a PMC_EXT so we can identify the owning interp */
+ /* We're sharing this, so make sure it has a PMC_sync */
Parrot_gc_add_pmc_sync(INTERP, ret);
PObj_is_PMC_shared_SET(ret);
Modified: branches/pluggable_runcore/src/pmc/scheduler.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/scheduler.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/scheduler.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -20,7 +20,7 @@
#include "parrot/scheduler_private.h"
-pmclass Scheduler need_ext auto_attrs {
+pmclass Scheduler auto_attrs {
ATTR INTVAL id; /* The scheduler's ID. */
ATTR INTVAL max_tid; /* The highest assigned task ID. */
Modified: branches/pluggable_runcore/src/pmc/schedulermessage.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/schedulermessage.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/schedulermessage.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -20,7 +20,7 @@
#include "parrot/scheduler_private.h"
-pmclass SchedulerMessage need_ext auto_attrs {
+pmclass SchedulerMessage auto_attrs {
ATTR INTVAL id; /* The message's ID. */
ATTR STRING *type; /* The message's type. */
ATTR PMC *data; /* Additional data for the message. */
Modified: branches/pluggable_runcore/src/pmc/sockaddr.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/sockaddr.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/sockaddr.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -29,7 +29,7 @@
}
#endif
-pmclass Sockaddr need_ext auto_attrs {
+pmclass Sockaddr auto_attrs {
ATTR void *pointer; /* The stored pointer. */
/*
Modified: branches/pluggable_runcore/src/pmc/stringhandle.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/stringhandle.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/stringhandle.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -46,7 +46,7 @@
return Parrot_str_equal(interp, s, CONST_STRING(interp, "utf8"));
}
-pmclass StringHandle extends Handle need_ext auto_attrs {
+pmclass StringHandle extends Handle auto_attrs {
ATTR INTVAL flags; /* Filehandle flags */
ATTR STRING *stringhandle; /* The string data */
ATTR STRING *mode; /* The mode string used in open */
Modified: branches/pluggable_runcore/src/pmc/sub.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/sub.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/sub.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -35,11 +35,7 @@
print_pbc_location(interp);
}
-/*
- * A sub now contains more data like namespace, which makes it
- * effectively a container. Therefore need_ext has to be set
- */
-pmclass Sub need_ext {
+pmclass Sub auto_attrs {
ATTR PackFile_ByteCode *seg; /* bytecode segment */
ATTR size_t start_offs; /* sub entry in ops from seg->base.data */
ATTR size_t end_offs;
@@ -94,11 +90,10 @@
*/
VTABLE void init() {
Parrot_Sub_attributes * const attrs =
- mem_allocate_zeroed_typed(Parrot_Sub_attributes);
+ (Parrot_Sub_attributes *) PMC_data(SELF);
attrs->seg = INTERP->code;
- PMC_data(SELF) = attrs;
PObj_custom_mark_destroy_SETALL(SELF);
}
@@ -122,11 +117,7 @@
Parrot_free_context(INTERP, sub->ctx, 1);
if (sub->outer_ctx)
Parrot_free_context(INTERP, sub->outer_ctx, 1);
-
- mem_sys_free(sub);
}
-
- PMC_data(SELF) = NULL;
}
/*
@@ -144,7 +135,9 @@
*/
VTABLE STRING *get_string() {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ STRING *name;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
if (sub->name)
return Parrot_str_copy(INTERP, sub->name);
@@ -153,7 +146,8 @@
}
VTABLE void set_string_native(STRING *subname) {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
sub->name = Parrot_str_copy(INTERP, subname);
}
@@ -186,7 +180,8 @@
*/
VTABLE void *get_pointer() {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
return sub->seg->base.data + sub->start_offs;
}
@@ -203,8 +198,9 @@
*/
VTABLE INTVAL get_integer_keyed(PMC *key) {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *sub;
UNUSED(key)
+ PMC_get_sub(INTERP, SELF, sub);
return (INTVAL) (sub->seg->base.data);
}
@@ -240,7 +236,7 @@
*/
VTABLE opcode_t *invoke(void *next) {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *sub;
Parrot_Context *caller_ctx;
Parrot_Context *context;
PMC *ccont;
@@ -344,13 +340,13 @@
PMC *outer_pmc;
Parrot_Sub_attributes *current_sub, *outer_sub;
- current_sub = PARROT_SUB(c->current_sub);
+ PMC_get_sub(INTERP, c->current_sub, current_sub);
outer_pmc = current_sub->outer_sub;
if (PMC_IS_NULL(outer_pmc))
break;
- outer_sub = PARROT_SUB(outer_pmc);
+ PMC_get_sub(INTERP, outer_pmc, outer_sub);
if (!outer_sub->ctx) {
Parrot_Context * const dummy = Parrot_alloc_context(INTERP,
@@ -409,14 +405,15 @@
VTABLE PMC *clone() {
PMC * const ret = pmc_new(INTERP, SELF->vtable->base_type);
- Parrot_Sub_attributes *dest_sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *dest_sub;
Parrot_Sub_attributes *sub;
/* XXX Why? */
/* we have to mark it ourselves */
PObj_custom_mark_destroy_SETALL(ret);
- sub = PARROT_SUB(ret);
+ PMC_get_sub(INTERP, SELF, dest_sub);
+ PMC_get_sub(INTERP, ret, sub);
/* release any previously held contexts */
if (sub->ctx)
@@ -459,8 +456,11 @@
VTABLE void assign_pmc(PMC *other) {
/* only handle the case where the other PMC is the same type */
if (other->vtable->base_type == SELF->vtable->base_type) {
- Parrot_Sub_attributes *my_sub = PARROT_SUB(SELF);
- Parrot_Sub_attributes *other_sub = PARROT_SUB(other);
+ Parrot_Sub_attributes *my_sub;
+ Parrot_Sub_attributes *other_sub;
+
+ PMC_get_sub(INTERP, SELF, my_sub);
+ PMC_get_sub(INTERP, other, other_sub);
/* Increase reference count of destination before
* freeing the one in self, to avoid problems in
@@ -537,8 +537,11 @@
*/
MULTI INTVAL is_equal(PMC *value) {
- Parrot_Sub_attributes *my_sub = PARROT_SUB(SELF);
- Parrot_Sub_attributes *value_sub = PARROT_SUB(value);
+ Parrot_Sub_attributes *my_sub;
+ Parrot_Sub_attributes *value_sub;
+
+ PMC_get_sub(INTERP, SELF, my_sub);
+ PMC_get_sub(INTERP, value, value_sub);
return SELF->vtable == value->vtable
&& (my_sub)->start_offs == (value_sub)->start_offs
@@ -587,12 +590,13 @@
}
VTABLE void freeze(visit_info *info) {
- IMAGE_IO * const io = info->image_io;
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
- STRING *hll_name;
+ IMAGE_IO * const io = info->image_io;
+ Parrot_Sub_attributes *sub;
+ STRING *hll_name;
int i;
SUPER(info);
+ PMC_get_sub(INTERP, SELF, sub);
/*
* we currently need to write these items:
* - start offset in byte-code segment
@@ -769,10 +773,12 @@
VTABLE PMC *inspect_str(STRING *what)
{
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *sub;
PMC *retval;
INTVAL count_found = -1;
+ PMC_get_sub(INTERP, SELF, sub);
+
/* If the argument info hasn't been generated yet, generate it. */
if (!sub->arg_info) {
/* Get pointer into the bytecode where this sub starts. */
@@ -893,8 +899,15 @@
*/
METHOD get_namespace() {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
- PMC *_namespace = sub->namespace_stash;
+ PMC *_namespace;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
+ /*
+ XXX Rakudo's failing with with this code on ASSERT. Why???
+ GET_ATTR_namespace_stash(INTERP, SELF, _namespace);
+ PARROT_ASSERT(_namespace == sub->namespace_stash || !"consistency!!!");
+ */
+ _namespace = sub->namespace_stash;
RETURN(PMC *_namespace);
}
@@ -904,10 +917,11 @@
* see also imcc/reg_alloc.c */
static const char types[] = "INSP";
char *p;
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *sub;
char * const kind = Parrot_str_to_cstring(interp, reg);
INTVAL regs_used;
+ PMC_get_sub(INTERP, SELF, sub);
PARROT_ASSERT(sub->n_regs_used);
if (!*kind || kind[1]) {
@@ -928,32 +942,39 @@
}
METHOD get_lexinfo() {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
PMC *lexinfo;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
+
+ lexinfo = sub->lex_info ? sub->lex_info: PMCNULL;
- lexinfo = sub->lex_info ? sub->lex_info : PMCNULL;
RETURN(PMC *lexinfo);
}
METHOD get_subid() {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
STRING *subid;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
subid = sub->subid ? sub->subid : CONST_STRING(interp, "");
+
RETURN(STRING *subid);
}
METHOD get_outer() {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
- PMC *outersub;
+ PMC *outersub;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
outersub = sub->outer_sub ? sub->outer_sub : PMCNULL;
+
RETURN(PMC *outersub);
}
METHOD set_outer(PMC *outer) {
/* Set outer sub. */
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
sub->outer_sub = outer;
@@ -976,10 +997,12 @@
}
METHOD get_multisig() {
- Parrot_Sub_attributes *sub = PARROT_SUB(SELF);
- PMC *multisig;
+ PMC *multisig;
+ Parrot_Sub_attributes *sub;
+ PMC_get_sub(INTERP, SELF, sub);
multisig = sub->multi_signature ? sub->multi_signature : PMCNULL;
+
RETURN(PMC *multisig);
}
Modified: branches/pluggable_runcore/src/pmc/task.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/task.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/task.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -20,7 +20,7 @@
#include "parrot/scheduler_private.h"
-pmclass Task need_ext auto_attrs {
+pmclass Task auto_attrs {
ATTR INTVAL id; /* The task ID. */
ATTR INTVAL priority; /* The priority of the task. */
ATTR FLOATVAL birthtime; /* The creation time stamp of the task. */
Modified: branches/pluggable_runcore/src/pmc/timer.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/timer.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/timer.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -57,7 +57,7 @@
#include "parrot/scheduler_private.h"
-pmclass Timer extends Task provides event need_ext auto_attrs {
+pmclass Timer extends Task provides event auto_attrs {
ATTR FLOATVAL duration; /* The duration of the timer pause */
ATTR FLOATVAL interval; /* How often to repeat */
ATTR INTVAL repeat; /* Whether to repeat:
Modified: branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc
==============================================================================
--- branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc/unmanagedstruct.pmc Thu Aug 27 18:38:59 2009 (r40830)
@@ -382,7 +382,7 @@
ret = *(PMC**) p;
/* now check if initializer has a signature attached */
- if (ptr->pmc_ext && PMC_metadata(ptr)) {
+ if (PMC_metadata(ptr)) {
STRING *signature_str = CONST_STRING(interp, "_signature");
PMC *sig = VTABLE_getprop(interp, ptr, signature_str);
if (VTABLE_defined(interp, sig)) {
@@ -398,9 +398,8 @@
/* check the metadata for an initializer */
/* grab the struct from the metadata */
- if (ptr->pmc_ext && PMC_metadata(ptr)) {
+ if (PMC_metadata(ptr))
ret = VTABLE_getprop(interp, ptr, CONST_STRING(interp, "_struct"));
- }
else {
Parrot_ex_throw_from_c_args(interp, NULL,
EXCEPTION_INVALID_OPERATION,
@@ -651,7 +650,7 @@
return toff;
}
-pmclass UnManagedStruct need_ext auto_attrs no_ro {
+pmclass UnManagedStruct auto_attrs no_ro {
ATTR void *ptr; /* the struct that this UnManagedStruct isn't managing */
ATTR PMC *init; /* the initializer used with this UnManagedStruct */
ATTR INTVAL size; /* the size of the struct */
Modified: branches/pluggable_runcore/src/pmc_freeze.c
==============================================================================
--- branches/pluggable_runcore/src/pmc_freeze.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/pmc_freeze.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -113,10 +113,6 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-static void pmc_add_ext(PARROT_INTERP, ARGIN(PMC *pmc))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
static void push_ascii_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -323,9 +319,6 @@
#define ASSERT_ARGS_op_check_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_pmc_add_ext __attribute__unused__ int _ASSERT_ARGS_CHECK = \
- PARROT_ASSERT_ARG(interp) \
- || PARROT_ASSERT_ARG(pmc)
#define ASSERT_ARGS_push_ascii_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(io)
@@ -463,17 +456,18 @@
str_append(PARROT_INTERP, ARGMOD(STRING *s), ARGIN(const void *b), size_t len)
{
ASSERT_ARGS(str_append)
+
const size_t used = s->bufused;
- const int need_free = (int)PObj_buflen(s) - used - len;
+ const int need_free = (int)Buffer_buflen(s) - used - len;
/*
* grow by factor 1.5 or such
*/
if (need_free <= 16) {
- size_t new_size = (size_t) (PObj_buflen(s) * 1.5);
- if (new_size < PObj_buflen(s) - need_free + 512)
- new_size = PObj_buflen(s) - need_free + 512;
+ size_t new_size = (size_t) (Buffer_buflen(s) * 1.5);
+ if (new_size < Buffer_buflen(s) - need_free + 512)
+ new_size = Buffer_buflen(s) - need_free + 512;
Parrot_gc_reallocate_string_storage(interp, s, new_size);
- PARROT_ASSERT(PObj_buflen(s) - used - len >= 15);
+ PARROT_ASSERT(Buffer_buflen(s) - used - len >= 15);
}
mem_sys_memcopy((void *)((ptrcast_t)s->strstart + used), b, len);
s->bufused += len;
@@ -591,6 +585,7 @@
shift_ascii_integer(SHIM_INTERP, ARGIN(IMAGE_IO *io))
{
ASSERT_ARGS(shift_ascii_integer)
+
char * const start = (char*)io->image->strstart;
char *p = start;
const INTVAL i = strtoul(p, &p, 10);
@@ -599,7 +594,9 @@
PARROT_ASSERT(p <= start + io->image->bufused);
io->image->strstart = p;
io->image->bufused -= (p - start);
+ io->image->strlen -= (p - start);
PARROT_ASSERT((int)io->image->bufused >= 0);
+
return i;
}
@@ -617,6 +614,7 @@
shift_ascii_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
{
ASSERT_ARGS(shift_ascii_number)
+
char * const start = (char*)io->image->strstart;
char *p = start;
const FLOATVAL f = (FLOATVAL) strtod(p, &p);
@@ -625,7 +623,9 @@
PARROT_ASSERT(p <= start + io->image->bufused);
io->image->strstart = p;
io->image->bufused -= (p - start);
+ io->image->strlen -= (p - start);
PARROT_ASSERT((int)io->image->bufused >= 0);
+
return f;
}
@@ -656,9 +656,11 @@
PARROT_ASSERT(p <= start + io->image->bufused);
io->image->strstart = p;
io->image->bufused -= (p - start);
+ io->image->strlen -= (p - start);
PARROT_ASSERT((int)io->image->bufused >= 0);
s = string_make(interp, start, p - start - 1, "iso-8859-1", 0);
/* s = string_make(interp, start, p - start - 1, "UTF-8", 0); */
+
return s;
}
@@ -678,6 +680,7 @@
shift_ascii_pmc(SHIM_INTERP, ARGIN(IMAGE_IO *io))
{
ASSERT_ARGS(shift_ascii_pmc)
+
char * const start = (char*)io->image->strstart;
char *p = start;
const unsigned long i = strtoul(p, &p, 16);
@@ -685,7 +688,9 @@
PARROT_ASSERT(p <= start + io->image->bufused);
io->image->strstart = p;
io->image->bufused -= (p - start);
+ io->image->strlen -= (p - start);
PARROT_ASSERT((int)io->image->bufused >= 0);
+
return (PMC*) i;
}
@@ -712,16 +717,17 @@
{
ASSERT_ARGS(op_check_size)
const size_t used = s->bufused;
- const int need_free = (int)PObj_buflen(s) - used - len;
+ const int need_free = (int)Buffer_buflen(s) - used - len;
+
/*
* grow by factor 1.5 or such
*/
if (need_free <= 16) {
- size_t new_size = (size_t) (PObj_buflen(s) * 1.5);
- if (new_size < PObj_buflen(s) - need_free + 512)
- new_size = PObj_buflen(s) - need_free + 512;
+ size_t new_size = (size_t) (Buffer_buflen(s) * 1.5);
+ if (new_size < Buffer_buflen(s) - need_free + 512)
+ new_size = Buffer_buflen(s) - need_free + 512;
Parrot_gc_reallocate_string_storage(interp, s, new_size);
- PARROT_ASSERT(PObj_buflen(s) - used - len >= 15);
+ PARROT_ASSERT(Buffer_buflen(s) - used - len >= 15);
}
#ifndef DISABLE_GC_DEBUG
Parrot_gc_compact_memory_pool(interp);
@@ -785,6 +791,7 @@
push_opcode_number(PARROT_INTERP, ARGIN(IMAGE_IO *io), FLOATVAL v)
{
ASSERT_ARGS(push_opcode_number)
+
const size_t len = PF_size_number() * sizeof (opcode_t);
STRING * const s = io->image;
const size_t used = s->bufused;
@@ -812,6 +819,7 @@
push_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(STRING *v))
{
ASSERT_ARGS(push_opcode_string)
+
const size_t len = PF_size_string(v) * sizeof (opcode_t);
STRING * const s = io->image;
const size_t used = s->bufused;
@@ -862,6 +870,7 @@
(const opcode_t **)opcode);
io->image->bufused -= ((char *)io->image->strstart - start);
+ io->image->strlen -= ((char *)io->image->strstart - start);
PARROT_ASSERT((int)io->image->bufused >= 0);
return i;
@@ -903,12 +912,14 @@
shift_opcode_number(SHIM_INTERP, ARGIN(IMAGE_IO *io))
{
ASSERT_ARGS(shift_opcode_number)
+
const char * const start = (const char *)io->image->strstart;
char **opcode = &io->image->strstart;
const FLOATVAL f = PF_fetch_number(io->pf,
(const opcode_t **)opcode);
io->image->bufused -= ((char *)io->image->strstart - start);
+ io->image->strlen -= ((char *)io->image->strstart - start);
PARROT_ASSERT((int)io->image->bufused >= 0);
return f;
@@ -930,12 +941,15 @@
shift_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io))
{
ASSERT_ARGS(shift_opcode_string)
+
char * const start = (char*)io->image->strstart;
- char **opcode = &io->image->strstart;
+ char * opcode = io->image->strstart;
STRING * const s = PF_fetch_string(interp, io->pf,
- (const opcode_t **)opcode);
+ (const opcode_t **)&opcode);
- io->image->bufused -= ((char *)io->image->strstart - start);
+ io->image->strstart = opcode;
+ io->image->bufused -= (opcode - start);
+ io->image->strlen -= (opcode - start);
PARROT_ASSERT((int)io->image->bufused >= 0);
return s;
@@ -949,22 +963,10 @@
=over 4
-=item C<static void pmc_add_ext(PARROT_INTERP, PMC *pmc)>
-
-Adds a C<PMC_EXT> to C<*pmc>.
-
=cut
*/
-static void
-pmc_add_ext(PARROT_INTERP, ARGIN(PMC *pmc))
-{
- ASSERT_ARGS(pmc_add_ext)
- if (pmc->vtable->flags & VTABLE_PMC_NEEDS_EXT)
- Parrot_gc_add_pmc_ext(interp, pmc);
-}
-
/*
* this function setup stuff may be replaced by a real PMC
* in the future
@@ -1019,6 +1021,7 @@
16 - PACKFILE_HEADER_BYTES % 16 : 0);
info->image_io = mem_allocate_typed(IMAGE_IO);
+
info->image_io->image = s = info->image;
#if FREEZE_ASCII
info->image_io->vtable = &ascii_funcs;
@@ -1026,6 +1029,7 @@
info->image_io->vtable = &opcode_funcs;
#endif
pf = info->image_io->pf = PackFile_new(interp, 0);
+
if (info->what == VISIT_FREEZE_NORMAL ||
info->what == VISIT_FREEZE_AT_DESTRUCT) {
@@ -1052,6 +1056,7 @@
mem_sys_memcopy(pf->header, s->strstart, PACKFILE_HEADER_BYTES);
PackFile_assign_transforms(pf);
s->bufused -= header_length;
+ s->strlen -= header_length;
LVALUE_CAST(char *, s->strstart) += header_length;
}
@@ -1171,6 +1176,7 @@
info->extra_flags = EXTRA_IS_NULL;
n = VTABLE_shift_pmc(interp, io);
+
if (((UINTVAL) n & 3) == 3) {
/* pmc has extra data */
info->extra_flags = VTABLE_shift_integer(interp, io);
@@ -1194,6 +1200,7 @@
*type = enum_class_Class;
}
}
+
*id = (UINTVAL) n;
return seen;
}
@@ -1356,8 +1363,7 @@
}
list_assign(interp, (List *)PMC_data(info->id_list), id, pmc, enum_type_PMC);
/* remember nested aggregates depth first */
- if (pmc->pmc_ext)
- list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+ list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
}
@@ -1396,10 +1402,9 @@
add_pmc_next_for_GC(SHIM_INTERP, ARGIN(PMC *pmc), ARGOUT(visit_info *info))
{
ASSERT_ARGS(add_pmc_next_for_GC)
- if (pmc->pmc_ext) {
- PMC_next_for_GC(info->mark_ptr) = pmc;
- info->mark_ptr = PMC_next_for_GC(pmc) = pmc;
- }
+ PMC_next_for_GC(info->mark_ptr) = pmc;
+ info->mark_ptr = PMC_next_for_GC(pmc) = pmc;
+
}
/*
@@ -1429,21 +1434,15 @@
return 1;
}
- /*
- * we can only remember PMCs with a next_for_GC pointer
- * which is located in pmc_ext
- */
- if (pmc->pmc_ext) {
- /* already seen? */
- if (!PMC_IS_NULL(PMC_next_for_GC(pmc))) {
- seen = 1;
- goto skip;
- }
- /* put pmc at the end of the list */
- PMC_next_for_GC(info->mark_ptr) = pmc;
- /* make end self-referential */
- info->mark_ptr = PMC_next_for_GC(pmc) = pmc;
+ /* already seen? */
+ if (!PMC_IS_NULL(PMC_next_for_GC(pmc))) {
+ seen = 1;
+ goto skip;
}
+ /* put pmc at the end of the list */
+ PMC_next_for_GC(info->mark_ptr) = pmc;
+ /* make end self-referential */
+ info->mark_ptr = PMC_next_for_GC(pmc) = pmc;
skip:
*id = id_from_pmc(interp, pmc);
return seen;
@@ -1500,8 +1499,7 @@
parrot_hash_put(interp,
(Hash *)VTABLE_get_pointer(interp, info->seen), pmc, (void*)*id);
/* remember containers */
- if (pmc->pmc_ext)
- list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
+ list_unshift(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
return 0;
}
@@ -1606,15 +1604,13 @@
ARGIN(visit_info *info))
{
ASSERT_ARGS(visit_loop_next_for_GC)
+ PMC *prev = NULL;
visit_next_for_GC(interp, current, info);
- if (current->pmc_ext) {
- PMC *prev = NULL;
- while (current != prev) {
- VTABLE_visit(interp, current, info);
- prev = current;
- current = PMC_next_for_GC(current);
- }
+ while (current != prev) {
+ VTABLE_visit(interp, current, info);
+ prev = current;
+ current = PMC_next_for_GC(current);
}
}
@@ -1685,11 +1681,8 @@
}
/* on thawing call thawfinish for each processed PMC */
- if (!finished_first) {
- /* the first create PMC might not be in the list,
- * if it has no pmc_ext */
+ if (!finished_first)
list_unshift(interp, finish_list, info->thaw_result, enum_type_PMC);
- }
n = list_length(interp, finish_list);
@@ -1797,7 +1790,8 @@
*/
LVALUE_CAST(char *, image->strstart) -= bufused;
image->bufused = bufused;
- PARROT_ASSERT(image->strstart >= (char *)PObj_bufstart(image));
+ image->strlen += bufused;
+ PARROT_ASSERT(image->strstart >= (char *)Buffer_bufstart(image));
if (gc_block) {
Parrot_unblock_GC_mark(interp);
Modified: branches/pluggable_runcore/src/string/api.c
==============================================================================
--- branches/pluggable_runcore/src/string/api.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/string/api.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -89,16 +89,16 @@
* also be sure not to allocate from the constant pool
*/
PObj_flags_CLEARALL(&for_alloc);
- Parrot_gc_allocate_string_storage(interp, &for_alloc, PObj_buflen(s));
+ Parrot_gc_allocate_string_storage(interp, &for_alloc, Buffer_buflen(s));
/* now copy memory over */
mem_sys_memcopy(for_alloc.strstart, s->strstart, s->bufused);
/* and finally use that string memory */
- PObj_bufstart(s) = PObj_bufstart(&for_alloc);
+ Buffer_bufstart(s) = Buffer_bufstart(&for_alloc);
s->strstart = for_alloc.strstart;
- PObj_buflen(s) = PObj_buflen(&for_alloc);
+ Buffer_buflen(s) = Buffer_buflen(&for_alloc);
/* COW_FLAG | external_FLAG */
PObj_is_external_CLEARALL(s);
@@ -148,7 +148,7 @@
/* XXX FIXME hack to avoid cross-interpreter issue until it
* is fixed correctly. */
if (n_interpreters > 1 && PObj_is_movable_TESTALL(s) &&
- !Parrot_gc_ptr_in_memory_pool(interp, PObj_bufstart(s))) {
+ !Parrot_gc_ptr_in_memory_pool(interp, Buffer_bufstart(s))) {
Parrot_str_write_COW(interp, d);
Parrot_io_eprintf(interp, "cross-interpreter copy of "
"relocatable string '%Ss' into tid %d\n",
@@ -215,8 +215,8 @@
if (dest) { /* && dest != src */
/* they are different, dest is not an external string */
#ifdef GC_IS_MALLOC
- if (!PObj_is_cowed_TESTALL(dest) && PObj_bufstart(dest)) {
- mem_sys_free(PObj_bufallocstart(dest));
+ if (!PObj_is_cowed_TESTALL(dest) && Buffer_bufstart(dest)) {
+ mem_sys_free(Buffer_bufallocstart(dest));
}
#endif
dest = Parrot_str_reuse_COW(interp, src, dest);
@@ -338,7 +338,7 @@
{
ASSERT_ARGS(string_capacity)
- return ((ptrcast_t)PObj_bufstart(s) + PObj_buflen(s) -
+ return ((ptrcast_t)Buffer_bufstart(s) + Buffer_buflen(s) -
(ptrcast_t)s->strstart);
}
@@ -524,7 +524,7 @@
return a;
/* Is A real? */
- if (a == NULL || PObj_bufstart(a) == NULL)
+ if (a == NULL || Buffer_bufstart(a) == NULL)
return Parrot_str_copy(interp, b);
saneify_string(a);
@@ -806,8 +806,8 @@
it was safe by setting PObj_external_FLAG.
(The cast is necessary to pacify TenDRA's tcc.)
*/
- PObj_bufstart(s) = s->strstart = PARROT_const_cast(char *, buffer);
- PObj_buflen(s) = s->bufused = len;
+ Buffer_bufstart(s) = s->strstart = PARROT_const_cast(char *, buffer);
+ Buffer_buflen(s) = s->bufused = len;
if (encoding == Parrot_fixed_8_encoding_ptr)
s->strlen = len;
@@ -855,7 +855,7 @@
/* Don't check buflen, if we are here, we already checked. */
Parrot_gc_reallocate_string_storage(interp,
- s, PObj_buflen(s) + string_max_bytes(interp, s, addlen));
+ s, Buffer_buflen(s) + string_max_bytes(interp, s, addlen));
return s;
}
@@ -1328,7 +1328,7 @@
diff = (end_byte - start_byte) - rep->bufused;
if (diff >= 0
- || ((INTVAL)src->bufused - (INTVAL)PObj_buflen(src)) <= diff) {
+ || ((INTVAL)src->bufused - (INTVAL)Buffer_buflen(src)) <= diff) {
Parrot_str_write_COW(interp, src);
if (diff != 0) {
@@ -2479,11 +2479,11 @@
*/
Parrot_str_write_COW(interp, s);
- size = PObj_buflen(s);
+ size = Buffer_buflen(s);
memory = (char *)mem_sys_allocate(size);
- mem_sys_memcopy(memory, PObj_bufstart(s), size);
- PObj_bufstart(s) = memory;
+ mem_sys_memcopy(memory, Buffer_bufstart(s), size);
+ Buffer_bufstart(s) = memory;
s->strstart = memory;
/* Mark the memory as both from the system and immobile */
@@ -2516,10 +2516,10 @@
return;
Parrot_str_write_COW(interp, s);
- size = PObj_buflen(s);
+ size = Buffer_buflen(s);
/* We need a handle on the fixed memory so we can get rid of it later */
- memory = PObj_bufstart(s);
+ memory = Buffer_bufstart(s);
/* Reallocate it the same size
* NOTE can't use Parrot_gc_reallocate_string_storage because of the LEA
@@ -2530,7 +2530,7 @@
Parrot_block_GC_sweep(interp);
Parrot_gc_allocate_string_storage(interp, s, size);
Parrot_unblock_GC_sweep(interp);
- mem_sys_memcopy(PObj_bufstart(s), memory, size);
+ mem_sys_memcopy(Buffer_bufstart(s), memory, size);
/* Mark the memory as neither immobile nor system allocated */
PObj_sysmem_CLEAR(s);
@@ -2722,7 +2722,7 @@
i += hex->strlen;
/* and usable len */
- charlen = PObj_buflen(result);
+ charlen = Buffer_buflen(result);
dp = (unsigned char *)result->strstart;
PARROT_ASSERT(i <= charlen);
Modified: branches/pluggable_runcore/src/string/charset/iso-8859-1.c
==============================================================================
--- branches/pluggable_runcore/src/string/charset/iso-8859-1.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/string/charset/iso-8859-1.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -268,12 +268,12 @@
for (offs = 0; offs < src->strlen; ++offs) {
const UINTVAL c = ENCODING_GET_BYTE(interp, src, offs);
- if (iter.bytepos >= PObj_buflen(dest) - 4) {
+ if (iter.bytepos >= Buffer_buflen(dest) - 4) {
UINTVAL need = (UINTVAL)((src->strlen - offs) * 1.5);
if (need < 16)
need = 16;
Parrot_gc_reallocate_string_storage(interp, dest,
- PObj_buflen(dest) + need);
+ Buffer_buflen(dest) + need);
}
iter.set_and_advance(interp, &iter, c);
}
Modified: branches/pluggable_runcore/src/string/charset/unicode.c
==============================================================================
--- branches/pluggable_runcore/src/string/charset/unicode.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/string/charset/unicode.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -440,7 +440,7 @@
/* use all available space - see below XXX */
/* TODO downcase, titlecase too */
- dest_len = PObj_buflen(src) / sizeof (UChar);
+ dest_len = Buffer_buflen(src) / sizeof (UChar);
src_len = src->bufused / sizeof (UChar);
/*
Modified: branches/pluggable_runcore/src/string/encoding/fixed_8.c
==============================================================================
--- branches/pluggable_runcore/src/string/encoding/fixed_8.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/string/encoding/fixed_8.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -634,7 +634,7 @@
{
ASSERT_ARGS(fixed8_set_position)
iter->bytepos = iter->charpos = pos;
- PARROT_ASSERT(pos <= PObj_buflen(iter->str));
+ PARROT_ASSERT(pos <= Buffer_buflen(iter->str));
}
Modified: branches/pluggable_runcore/src/string/encoding/utf8.c
==============================================================================
--- branches/pluggable_runcore/src/string/encoding/utf8.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/string/encoding/utf8.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -525,7 +525,7 @@
i->bytepos += (new_pos - pos);
/* XXX possible buffer overrun exception? */
- PARROT_ASSERT(i->bytepos <= PObj_buflen(s));
+ PARROT_ASSERT(i->bytepos <= Buffer_buflen(s));
i->charpos++;
}
Modified: branches/pluggable_runcore/src/vtables.c
==============================================================================
--- branches/pluggable_runcore/src/vtables.c Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/src/vtables.c Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,6 +19,10 @@
#include "parrot/parrot.h"
#include "parrot/vtables.h"
+/* This function is defined in the auto-generated file core_pmcs.c */
+/* XXX Get it into some public place */
+extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass);
+
/* HEADERIZER HFILE: include/parrot/vtables.h */
/*
@@ -222,6 +226,28 @@
}
/*
+
+=item C<void Parrot_initialize_core_vtables(PARROT_INTERP)>
+
+Initialize vtables for the core PMCs.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_initialize_core_vtables(PARROT_INTERP)
+{
+ ASSERT_ARGS(Parrot_initialize_core_vtables)
+
+ if (! interp->vtables) {
+ parrot_alloc_vtables(interp);
+ Parrot_initialize_core_pmcs(interp, 0);
+ }
+}
+
+/*
* Local variables:
* c-file-style: "parrot"
* End:
Modified: branches/pluggable_runcore/t/library/rand.t
==============================================================================
--- branches/pluggable_runcore/t/library/rand.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/library/rand.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,16 +1,10 @@
-#!perl
+#!parrot
# Copyright (C) 2009, Parrot Foundation.
# $Id$
-use strict;
-use warnings;
-use lib qw( t . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
=head1 NAME
-t/library/rand.t - rand tests
+t/library/rand.t - Test the Math::Rand PBC
=head1 SYNOPSIS
@@ -18,47 +12,42 @@
=cut
-pir_output_is( << 'CODE', << 'OUTPUT', 'rand / srand' );
-.sub test :main
+.sub main :main
+ .include 'test_more.pir'
+
+ plan(7)
+ test_rand_srand()
+ test_rand_max()
+.end
+
+.sub test_rand_srand
load_bytecode 'Math/Rand.pbc'
.local pmc rand
rand = get_global [ 'Math'; 'Rand' ], 'rand'
.local pmc srand
srand = get_global [ 'Math'; 'Rand' ], 'srand'
$I0 = rand()
- say $I0
+ is($I0,16838)
$I0 = rand()
- say $I0
+ is($I0,5758)
$I0 = rand()
- say $I0
+ is($I0,10113)
$I0 = rand()
- say $I0
+ is($I0,17515)
srand(1)
$I0 = rand()
- say $I0
+ is($I0,16838)
$I0 = rand()
- say $I0
+ is($I0,5758)
.end
-CODE
-16838
-5758
-10113
-17515
-16838
-5758
-OUTPUT
-pir_output_is( << 'CODE', << 'OUTPUT', 'RAND_MAX' );
-.sub test :main
+.sub test_rand_max
load_bytecode 'Math/Rand.pbc'
.local pmc rand_max
rand_max = get_global [ 'Math'; 'Rand' ], 'RAND_MAX'
$I0 = rand_max()
- say $I0
+ is($I0,32767)
.end
-CODE
-32767
-OUTPUT
# Local Variables:
Modified: branches/pluggable_runcore/t/op/arithmetics.t
==============================================================================
--- branches/pluggable_runcore/t/op/arithmetics.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/op/arithmetics.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 26;
+use Parrot::Test tests => 21;
# test for GMP
use Parrot::Config;
@@ -594,108 +594,6 @@
OUTPUT
}
-pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - basic arith" );
-.sub 'test' :main
- $N0 = 'Inf'
- say $N0
- $N0 -= $N0
- say $N0
- $N0 *= -1
- say $N0
- $N0 *= 0
- say $N0
- $N0 += 5
- say $N0
- $N0 -= 42
- say $N0
-.end
-CODE
-Inf
-NaN
-NaN
-NaN
-NaN
-NaN
-OUTPUT
-
-pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - exp" );
-.sub 'test' :main
- $N0 = 'Inf'
- $N1 = exp $N0
- say $N1
- $N0 = '-Inf'
- $N1 = exp $N0
- say $N1
- $N0 = 'NaN'
- $N1 = exp $N0
- say $N1
-.end
-CODE
-Inf
-0
-NaN
-OUTPUT
-
-pir_output_is( <<'CODE', <<OUTPUT, "Inf - ln" );
-.sub 'test' :main
- $N0 = 'Inf'
- $N1 = ln $N0
- say $N1
- $N0 = '-Inf'
- $N1 = ln $N0
- say $N1
-.end
-CODE
-Inf
-NaN
-OUTPUT
-
-pir_output_is( <<'CODE', <<OUTPUT, "Mixing NaN and Inf should give NaN" );
-.sub 'test' :main
- $N0 = 'NaN'
- $N1 = 'Inf'
- $N0 *= $N1
- say $N0
- $N0 /= $N1
- say $N0
- $N0 -= $N1
- say $N0
- $N0 += $N1
- say $N0
-.end
-CODE
-NaN
-NaN
-NaN
-NaN
-OUTPUT
-
-pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - rounding" );
-.sub 'test' :main
- $N0 = 'NaN'
- $N1 = floor $N0
- say $N1
- $N2 = ceil $N0
- say $N2
- $N0 = 'Inf'
- $N1 = floor $N0
- say $N1
- $N2 = ceil $N0
- say $N2
- $N0 = '-Inf'
- $N1 = floor $N0
- say $N1
- $N2 = ceil $N0
- say $N2
-.end
-CODE
-NaN
-NaN
-Inf
-Inf
--Inf
--Inf
-OUTPUT
# Local Variables:
# mode: cperl
Modified: branches/pluggable_runcore/t/op/gc.t
==============================================================================
--- branches/pluggable_runcore/t/op/gc.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/op/gc.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -23,22 +23,26 @@
=cut
-pasm_output_is( <<'CODE', '1', "sweep 1" );
- interpinfo I1, 2 # How many GC mark runs have we done already?
+pir_output_is( <<'CODE', '1', "sweep 1" );
+.include 'interpinfo.pasm'
+.sub main :main
+ $I1 = interpinfo .INTERPINFO_GC_MARK_RUNS # How many GC mark runs have we done already?
sweep 1
- interpinfo I2, 2 # Should be one more now
- sub I3, I2, I1
- print I3
- end
+ $I2 = interpinfo .INTERPINFO_GC_MARK_RUNS # Should be one more now
+ $I3 = $I2 - $I1
+ print $I3
+.end
CODE
-pasm_output_is( <<'CODE', '0', "sweep 0" );
- interpinfo I1, 2 # How many GC mark runs have we done already?
+pir_output_is( <<'CODE', '0', "sweep 0" );
+.include 'interpinfo.pasm'
+.sub main :main
+ $I1 = interpinfo .INTERPINFO_GC_MARK_RUNS # How many GC mark runs have we done already?
sweep 0
- interpinfo I2, 2 # Should be same
- sub I3, I2, I1
- print I3
- end
+ $I2 = interpinfo .INTERPINFO_GC_MARK_RUNS # Should be same
+ $I3 = $I2 - $I1
+ print $I3
+.end
CODE
pasm_output_is( <<'CODE', '1', "sweep 0, with object that need destroy" );
@@ -68,13 +72,15 @@
end
CODE
-pasm_output_is( <<'CODE', '1', "collect" );
- interpinfo I1, 3 # How many garbage collections have we done already?
+pir_output_is( <<'CODE', '1', "collect" );
+.include 'interpinfo.pasm'
+.sub main :main
+ $I1 = interpinfo .INTERPINFO_GC_COLLECT_RUNS # How many garbage collections have we done already?
collect
- interpinfo I2, 3 # Should be one more now
- sub I3, I2, I1
- print I3
- end
+ $I2 = interpinfo .INTERPINFO_GC_COLLECT_RUNS # Should be one more now
+ $I3 = $I2 - $I1
+ print $I3
+.end
CODE
pasm_output_is( <<'CODE', <<'OUTPUT', "collectoff/on" );
@@ -123,33 +129,33 @@
1
OUTPUT
-pasm_output_is( <<'CODE', <<OUTPUT, "vanishing singleton PMC" );
-_main:
- .const 'Sub' P0 = "_rand"
- new P16, 'Env'
- set P16['Foo'], 'bar'
- set I16, 100
- set I17, 0
-loop:
- sweep 1
- invokecc P0
- inc I17
- lt I17, I16, loop
- print "ok\n"
- end
+pir_output_is( <<'CODE', <<OUTPUT, "vanishing singleton PMC" );
+.sub main :main
+ $P16 = new 'Env'
+ $P16['Foo'] = 'bar'
+ $I16 = 100
+ $I17 = 0
+
+ loop:
+ sweep 1
+ _rand()
+ $I17 += 1
+ if $I17 <= $I16 goto loop
+ say "ok"
+.end
+
+.sub _rand
+ $P16 = new 'Env'
+ $P5 = $P16['Foo']
+ if $P5 != 'bar' goto err
+ .return()
+ err:
+ say "singleton destroyed .Env = ."
+ $P16 = new 'Env'
+ $S16 = typeof $P16
+ say $S16
+.end
-.pcc_sub _rand:
- new P16, 'Env'
- set P5, P16['Foo']
- ne P5, 'bar', err
- returncc
-err:
- print "singleton destroyed .Env = ."
- new P16, 'Env'
- typeof S16, P16
- print S16
- print "\n"
- end
CODE
ok
OUTPUT
Copied: branches/pluggable_runcore/t/op/inf_nan.t (from r40829, trunk/t/op/inf_nan.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/pluggable_runcore/t/op/inf_nan.t Thu Aug 27 18:38:59 2009 (r40830, copy of r40829, trunk/t/op/inf_nan.t)
@@ -0,0 +1,652 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Test::More;
+use Parrot::Test tests => 32;
+
+=head1 NAME
+
+t/op/inf_nan.t - Test math properties of Inf and NaN
+
+=head1 SYNOPSIS
+
+ % prove t/op/inf_nan.t
+
+=head1 DESCRIPTION
+
+Tests for mathematical operations with Inf and Nan.
+
+=cut
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - basic arith" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ say $N0
+ $N0 -= $N0
+ say $N0
+ $N0 *= -1
+ say $N0
+ $N0 *= 0
+ say $N0
+ $N0 += 5
+ say $N0
+ $N0 -= 42
+ say $N0
+ inc $N0
+ say $N0
+ dec $N0
+ say $N0
+ $N2 = abs $N0
+ say $N2
+ $N1 = 'Inf'
+ $N3 = abs $N1
+ say $N3
+ $N1 = '-Inf'
+ $N3 = abs $N1
+ say $N3
+.end
+CODE
+Inf
+NaN
+NaN
+NaN
+NaN
+NaN
+NaN
+NaN
+NaN
+Inf
+Inf
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - exp" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = exp $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = exp $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = exp $N0
+ say $N1
+.end
+CODE
+Inf
+0
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - sqrt" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = sqrt $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = sqrt $N0
+ say $N1
+ $N0 = -1
+ $N1 = sqrt $N0
+ say $N1
+.end
+CODE
+Inf
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - sin" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = sin $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = sin $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = sin $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - sinh" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = sinh $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = sinh $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = sinh $N0
+ say $N1
+.end
+CODE
+Inf
+-Inf
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - asin" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = asin $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = asin $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = asin $N0
+ say $N1
+ $N0 = '-2'
+ $N1 = asin $N0
+ say $N1
+ $N0 = '2'
+ $N1 = asin $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - cos" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = cos $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = cos $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = cos $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - cosh" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = cosh $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = cosh $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = cosh $N0
+ say $N1
+.end
+CODE
+Inf
+Inf
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - acos" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = acos $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = acos $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = acos $N0
+ say $N1
+ $N0 = '-2'
+ $N1 = acos $N0
+ say $N1
+ $N0 = '2'
+ $N1 = acos $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - tan" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = tan $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = tan $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = tan $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - tanh" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = tanh $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = tanh $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = tanh $N0
+ say $N1
+.end
+CODE
+1
+-1
+NaN
+OUTPUT
+
+pir_output_like( <<'CODE',qr/^1.5707963.*^-1.5707963.*^NaN/ms,"Inf/NaN - atan" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = atan $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = atan $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = atan $N0
+ say $N1
+.end
+CODE
+
+{
+local $TODO = 'cot/coth/acot not implemented for real numbers';
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - cot" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = cot $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = cot $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = cot $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - coth" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = coth $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = coth $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = coth $N0
+ say $N1
+.end
+CODE
+1
+-1
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - acot" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = acot $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = acot $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = acot $N0
+ say $N1
+ $N0 = '-2'
+ $N1 = acot $N0
+ say $N1
+ $N0 = '2'
+ $N1 = acot $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+NaN
+NaN
+OUTPUT
+}
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - sec" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = sec $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = sec $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = sec $N0
+ say $N1
+.end
+CODE
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - sech" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = sech $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = sech $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = sech $N0
+ say $N1
+.end
+CODE
+0
+0
+NaN
+OUTPUT
+
+pir_output_like( <<'CODE',qr/^1.5707963.*^1.5707963.*^NaN/ms,"Inf/NaN - asec" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = asec $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = asec $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = asec $N0
+ say $N1
+.end
+CODE
+
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - ln" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = ln $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = ln $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = ln $N0
+ say $N1
+.end
+CODE
+Inf
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - log10" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = log10 $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = log10 $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = log10 $N0
+ say $N1
+.end
+CODE
+Inf
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - log2" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = log2 $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = log2 $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = log2 $N0
+ say $N1
+.end
+CODE
+Inf
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - neg" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ $N1 = neg $N0
+ say $N1
+ $N0 = '-Inf'
+ $N1 = neg $N0
+ say $N1
+ $N0 = 'NaN'
+ $N1 = neg $N0
+ say $N1
+.end
+CODE
+-Inf
+Inf
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - pow" );
+.sub 'test' :main
+ $N0 = 'Inf'
+ pow $N1, $N0, 2
+ say $N1
+ pow $N1, 2, $N0
+ say $N1
+ $N0 = 'NaN'
+ pow $N1, $N0, 2
+ say $N1
+ pow $N1, 2, $N0
+ say $N1
+.end
+CODE
+Inf
+Inf
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Mixing NaN and Inf should give NaN" );
+.sub 'test' :main
+ $N0 = 'NaN'
+ $N1 = 'Inf'
+ $N0 *= $N1
+ say $N0
+ $N0 /= $N1
+ say $N0
+ $N0 -= $N1
+ say $N0
+ $N0 += $N1
+ say $N0
+.end
+CODE
+NaN
+NaN
+NaN
+NaN
+OUTPUT
+
+pir_output_is( <<'CODE', <<OUTPUT, "Inf/NaN - rounding" );
+.sub 'test' :main
+ $N0 = 'NaN'
+ $N1 = floor $N0
+ say $N1
+ $N2 = ceil $N0
+ say $N2
+ $N0 = 'Inf'
+ $N1 = floor $N0
+ say $N1
+ $N2 = ceil $N0
+ say $N2
+ $N0 = '-Inf'
+ $N1 = floor $N0
+ say $N1
+ $N2 = ceil $N0
+ say $N2
+.end
+CODE
+NaN
+NaN
+Inf
+Inf
+-Inf
+-Inf
+OUTPUT
+
+TODO: {
+
+local $TODO = 'rounding nan/inf gives something like -2147483648';
+pir_output_is(<<'CODE',<<OUTPUT, "TT #370 Rounding inf/nan");
+.sub 'main'
+ $N0 = 'Inf'
+ $I0 = floor $N0
+ say $I0
+ $N0 = 'NaN'
+ $I0 = floor $N0
+ say $I0
+ $N0 = 'Inf'
+ $I0 = ceil $N0
+ say $I0
+ $N0 = 'NaN'
+ $I0 = ceil $N0
+ say $I0
+ .end
+CODE
+Inf
+NaN
+Inf
+NaN
+OUTPUT
+
+}
+
+TODO: {
+local $TODO = '1+i + NaN should be NaN';
+pir_output_is(<<'CODE',<<OUTPUT,"Adding NaN to a Complex");
+.sub main
+ $P1 = new ["Complex"]
+ $N0 = 'NaN'
+ set $P1, "1 + i"
+ $P1 += $N0
+ say $P1
+.end
+CODE
+NaN
+OUTPUT
+}
+
+{
+local $TODO = 'fdiv/mod/cmod do not play nicely with PMCs and NaN';
+pir_output_is(<<'CODE',<<OUTPUT,'fdiv with Integer PMCs and NaN');
+.sub main
+ $P1 = new "Integer"
+ $P2 = new "Integer"
+ $P2 = 1
+ $N0 = 'NaN'
+ fdiv $P1, $P2, $N0
+ say $P1
+.end
+CODE
+NaN
+OUTPUT
+
+pir_output_is(<<'CODE',<<OUTPUT,'fdiv with Float PMCs and NaN');
+.sub main
+ $P1 = new 'Float'
+ $P2 = new 'Float'
+ $P2 = 1
+ $N0 = 'NaN'
+ fdiv $P1, $P2, $N0
+ say $P1
+.end
+CODE
+NaN
+OUTPUT
+
+pir_output_is(<<'CODE',<<OUTPUT,'fdiv with Float and Integer PMCs and NaN');
+.sub main
+ $P1 = new 'Float'
+ $P2 = new 'Integer'
+ $P2 = 1
+ $N0 = 'NaN'
+ fdiv $P1, $P2, $N0
+ say $P1
+.end
+CODE
+NaN
+OUTPUT
+
+pir_output_is(<<'CODE',<<OUTPUT,'cmod with Float and Integer PMCs and NaN');
+.sub main
+ $P1 = new 'Float'
+ $P2 = new 'Integer'
+ $P2 = 1
+ $N0 = 'NaN'
+ cmod $P1, $P2, $N0
+ say $P1
+.end
+CODE
+NaN
+OUTPUT
+
+pir_output_is(<<'CODE',<<OUTPUT,'mod with Float and Integer PMCs and NaN');
+.sub main
+ $P1 = new 'Float'
+ $P2 = new 'Integer'
+ $P2 = 1
+ $N0 = 'NaN'
+ mod $P1, $P2, $N0
+ say $P1
+.end
+CODE
+NaN
+OUTPUT
+}
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+
Modified: branches/pluggable_runcore/t/pmc/default.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/default.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/pmc/default.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2006-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2006-2009, Parrot Foundation.
# $Id$
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
=head1 NAME
t/pmc/default.t - test default PMC
@@ -23,17 +17,20 @@
=cut
-pir_output_is( <<'CODE', <<'OUT', 'new', todo => 'not implemeted' );
-.sub 'test' :main
- new P0, ['default']
- print "ok 1\n"
+.sub main :main
+ .include 'test_more.pir'
+
+ plan(3)
+ test_default()
+ test_inspect_vtable_function()
.end
-CODE
-ok 1
-OUT
-pir_output_is( <<'CODE', <<'OUT', 'inspect vtable function');
-.sub 'test' :main
+.sub test_default
+ #new $P0, ['default']
+ todo(0,'the default PMC does not exist')
+.end
+
+.sub test_inspect_vtable_function
$P0 = new ['String']
$P1 = inspect $P0, 'flags'
$I9 = 1 << 9 # PObj_is_PMC_FLAG
@@ -41,22 +38,11 @@
$I0 = $P1
$I1 = $I0 & $I9
-
- if $I1 goto ok_1
- print "not "
- ok_1:
- print "ok 1\n"
+ ok($I1)
$I1 = $I0 & $I29
- unless $I1 goto ok_2
- print "not "
- ok_2:
- print "ok 2\n"
+ nok($I1)
.end
-CODE
-ok 1
-ok 2
-OUT
# Local Variables:
# mode: cperl
Modified: branches/pluggable_runcore/t/pmc/parrotinterpreter.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/parrotinterpreter.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/pmc/parrotinterpreter.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -1,13 +1,7 @@
-#!perl
-# Copyright (C) 2006-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2006-2009, Parrot Foundation.
# $Id$
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 2;
-
=head1 NAME
t/pmc/parrotinterpreter.t - test the ParrotInterpreter PMC
@@ -23,19 +17,23 @@
=cut
-pir_output_is( <<'CODE', <<'OUT', 'create new interpreter' );
-.sub 'test' :main
+.sub main :main
+ .include 'test_more.pir'
+
+ plan(3)
+ test_new()
+ test_hll_map()
+.end
+
+.sub test_new
new $P0, ['ParrotInterpreter']
- print "ok 1\n"
+ ok(1,'new')
.end
-CODE
-ok 1
-OUT
-pir_output_is( <<'CODE', <<'OUT', 'setting HLL map dynamically' );
.HLL 'Perl6'
-.sub 'main' :main
+.sub test_hll_map
+ .include 'test_more.pir'
$P0 = get_class 'Integer'
$P1 = subclass $P0, 'MyInt'
@@ -43,18 +41,14 @@
$P2.'hll_map'($P0, $P1)
$P3 = 'foo'()
- say $P3 # "3\n"
+ is($P3,3)
$S0 = typeof $P3
- say $S0 # "MyInt"
+ is($S0,"MyInt")
.end
-.sub 'foo'
+.sub foo
.return (3)
.end
-CODE
-3
-MyInt
-OUT
# Local Variables:
# mode: cperl
Modified: branches/pluggable_runcore/t/pmc/pmc.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/pmc.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/pmc/pmc.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -24,24 +24,26 @@
=cut
-pasm_output_is( <<'CODE', <<'OUTPUT', "newpmc" );
- print "starting\n"
- new P0, ['Integer']
- print "ending\n"
- end
+pir_output_is( <<'CODE', <<'OUTPUT', "newpmc" );
+.sub main
+ say "starting"
+ new $P0, ['Integer']
+ say "ending"
+.end
CODE
starting
ending
OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', 'typeof' );
- new P0, ['Integer']
- typeof S0,P0
- eq S0, "Integer", OK_1
+pir_output_is( <<'CODE', <<'OUTPUT', 'typeof' );
+.sub main
+ new $P0, ['Integer']
+ typeof $S0, $P0
+ eq $S0, "Integer", OK_1
print "not "
OK_1:
print "ok 1\n"
- end
+.end
CODE
ok 1
OUTPUT
@@ -56,203 +58,207 @@
while ( my ( $type, $id ) = each %pmc_types ) {
next
if $types_we_cant_test{$type};
- my $set_ro = ( $type =~ /^Const\w+/ ) ? <<EOPASM : '';
- new P10, ['Integer']
- set P10, 1
- setprop P0, "_ro", P10
-EOPASM
- $checkTypes .= <<"CHECK";
- new P0, '$type'
- $set_ro
- set S1, "$type"
- typeof S0, P0
- ne S0, S1, L_BadName
+ my $set_ro = ( $type =~ /^Const\w+/ ) ? <<'PIR' : '';
+ new $P10, ['Integer']
+ set $P10, 1
+ setprop $P0, "_ro", $P10
+PIR
+ $checkTypes .= qq{ new \$P0, '$type'\n$set_ro\n};
+ $checkTypes .= qq{ set \$S1, "$type"\n};
+ $checkTypes .= <<'CHECK';
+ typeof $S0, $P0
+ ne $S0, $S1, L_BadName
CHECK
}
-pasm_output_like( <<"CODE", <<OUTPUT, "PMC type check" );
- new P10, ['Hash']
- new P11, ['Hash']
+pir_output_like( <<"CODE", qr/All names ok/, "PMC type check" );
+.sub main
+ new \$P10, ['Hash']
+ new \$P11, ['Hash']
$checkTypes
- print "All names ok.\\n"
+ say "All names ok."
end
L_BadName:
- print S1
+ print \$S1
print " PMCs have incorrect name \\""
- print S0
+ print \$S0
print "\\"\\n"
- end
+.end
CODE
-/All names ok/
-OUTPUT
-pasm_error_output_like( <<'CODE', <<'OUTPUT', 'find_method' );
- new P1, ['Integer']
- find_method P0, P1, "no_such_meth"
- end
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'find_method' );
+.sub main
+ new $P1, ['Integer']
+ find_method $P0, $P1, "no_such_meth"
+.end
CODE
/Method 'no_such_meth' not found for invocant of class 'Integer'/
OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "eq_addr same" );
- new P0, ['Integer']
- set P1, P0
- eq_addr P0, P1, OK1
+pir_output_is( <<'CODE', <<'OUTPUT', "eq_addr same" );
+.sub main
+ new $P0, ['Integer']
+ set $P1, $P0
+ eq_addr $P0, $P1, OK1
print "not "
OK1: print "ok 1\n"
- ne_addr P0, P1, BAD2
+ ne_addr $P0, $P1, BAD2
branch OK2
BAD2: print "not "
OK2: print "ok 2\n"
- end
+.end
CODE
ok 1
ok 2
OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "eq_addr diff" );
- new P0, ['Integer']
- new P1, ['Integer']
- ne_addr P0, P1, OK1
+pir_output_is( <<'CODE', <<'OUTPUT', "eq_addr diff" );
+.sub main
+ new $P0, ['Integer']
+ new $P1, ['Integer']
+ ne_addr $P0, $P1, OK1
print "not "
OK1: print "ok 1\n"
- eq_addr P0, P1, BAD2
+ eq_addr $P0, $P1, BAD2
branch OK2
BAD2: print "not "
OK2: print "ok 2\n"
- end
+.end
CODE
ok 1
ok 2
OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "if_null" );
- null P0
- if_null P0, OK1
+pir_output_is( <<'CODE', <<'OUTPUT', "if_null" );
+.sub main
+ null $P0
+ if_null $P0, OK1
print "not "
OK1: print "ok 1\n"
- new P0, ['Integer']
- if_null P0, BAD2
+ new $P0, ['Integer']
+ if_null $P0, BAD2
branch OK2
BAD2: print "not "
OK2: print "ok 2\n"
- end
+.end
CODE
ok 1
ok 2
OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "Env PMCs are singletons" );
- new P0, ['Env']
- new P1, ['Env']
- eq_addr P0, P1, ok
+pir_output_is( <<'CODE', <<'OUTPUT', "Env PMCs are singletons" );
+.sub main
+ new $P0, ['Env']
+ new $P1, ['Env']
+ eq_addr $P0, $P1, ok
print "not the same "
ok: print "ok\n"
- end
+.end
CODE
ok
OUTPUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "issame" );
- new P0, ['Undef']
- new P1, ['Undef']
- set P1, P0
- issame I0, P0, P1
- print I0
- isntsame I0, P0, P1
- print I0
- new P2, ['Undef']
- issame I0, P0, P2
- print I0
- isntsame I0, P0, P2
- print I0
- print "\n"
- end
+pir_output_is( <<'CODE', <<'OUTPUT', "issame" );
+.sub main
+ new $P0, ['Undef']
+ new $P1, ['Undef']
+ set $P1, $P0
+ issame $I0, $P0, $P1
+ print $I0
+ isntsame $I0, $P0, $P1
+ print $I0
+ new $P2, ['Undef']
+ issame $I0, $P0, $P2
+ print $I0
+ isntsame $I0, $P0, $P2
+ say $I0
+.end
CODE
1001
OUTPUT
-pasm_output_is( <<'CODE', <<'OUT', ".const - Sub constant" );
-.pcc_sub :main main:
+pir_output_is( <<'CODE', <<'OUT', ".const - Sub constant" );
+.sub main
print "ok 1\n"
- .const 'Sub' P0 = "foo"
- invokecc P0
+ .const 'Sub' $P0 = "foo"
+ invokecc $P0
print "ok 3\n"
- end
-.pcc_sub foo:
+.end
+.sub foo
print "ok 2\n"
returncc
+.end
CODE
ok 1
ok 2
ok 3
OUT
-pir_output_is( <<'CODE', <<'OUT', "pmc constant 1" );
+pir_output_is( <<'CODE', <<'OUT', "Integer pmc constant " );
.sub main :main
.const 'Integer' i = "42"
- print i
- print "\n"
+ say i
.end
CODE
42
OUT
-pir_output_is( <<'CODE', <<'OUT', "pmc constant 2" );
+pir_output_is( <<'CODE', <<'OUT', "Float pmc constant " );
.sub main :main
- .const 'Integer' i = "42"
- print i
- print "\n"
+ .const 'Float' j = "4.2"
+ say j
.end
CODE
-42
+4.2
OUT
-pasm_output_is( <<'CODE', <<'OUT', "pmc constant PASM" );
- .const 'Integer' P0 = "42"
- print P0
- print "\n"
- end
+pir_output_is( <<'CODE', <<'OUT', "pmc constant" );
+.sub main
+ .const 'Integer' $P0 = "42"
+ say $P0
+.end
CODE
42
OUT
-pasm_output_is( <<'CODE', <<'OUT', "logical or, and, xor" );
- new P0, ['Integer']
- set P0, 2
- new P1, ['Undef']
- or P2, P0, P1
- eq_addr P2, P0, ok1
+pir_output_is( <<'CODE', <<'OUT', "logical or, and, xor" );
+.sub main
+ new $P0, ['Integer']
+ set $P0, 2
+ new $P1, ['Undef']
+ or $P2, $P0, $P1
+ eq_addr $P2, $P0, ok1
print "not "
ok1:
print "ok 1\n"
- and P2, P0, P1
- eq_addr P2, P1, ok2
+ and $P2, $P0, $P1
+ eq_addr $P2, $P1, ok2
print "not "
ok2:
print "ok 2\n"
- xor P2, P0, P1
- eq_addr P2, P0, ok3
+ xor $P2, $P0, $P1
+ eq_addr $P2, $P0, ok3
print "not "
ok3:
print "ok 3\n"
- end
+.end
CODE
ok 1
ok 2
ok 3
OUT
-pasm_output_is( <<'CODE', <<'OUTPUT', "new_p_s" );
- new P3, ['Integer']
- set P3, "42"
- typeof S0, P3
- print S0
+pir_output_is( <<'CODE', <<'OUTPUT', "new_p_s" );
+.sub main
+ new $P3, ['Integer']
+ set $P3, "42"
+ typeof $S0, $P3
+ print $S0
print "\n"
- set I0, P3
- print I0
+ set $I0, $P3
+ print $I0
print "\n"
- end
+.end
CODE
String
42
Modified: branches/pluggable_runcore/t/pmc/threads.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/threads.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/pmc/threads.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -535,7 +535,7 @@
OUTPUT
}
-pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_CLASSES; superclass built-in" );
+pir_output_is( <<'CODE', <<'OUTPUT', "CLONE_CODE | CLONE_CLASSES; superclass built-in", todo => 'likely incorrect test');
.namespace [ 'Foo' ]
.sub foometh :method
Modified: branches/pluggable_runcore/t/pmc/undef.t
==============================================================================
--- branches/pluggable_runcore/t/pmc/undef.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/pmc/undef.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -19,7 +19,7 @@
.sub main :main
.include 'test_more.pir'
- plan(21)
+ plan(22)
morph_to_string()
undef_pmc_is_false()
@@ -169,19 +169,30 @@
.sub set_undef_to_object
$P0 = new "Undef"
+ $P1 = get_class 'Integer'
$P2 = new 'Integer'
assign $P0, $P2
- ok( 1, 'Assign Integer to Undef' )
+ $I0 = isa $P0, $P1
+ ok( $I0, 'Assign Integer to Undef' )
$P0 = new "Undef"
$P1 = newclass "HI"
$P2 = new $P1
assign $P0, $P2
- ok( 1, 'Assign Object to Undef' )
+ $I0 = isa $P0, $P1
+ ok( $I0, 'Assign Object to Undef' )
+
+ $P0 = new "Undef"
+ $P1 = subclass 'ResizablePMCArray', 'FooRPA'
+ $P2 = new $P1
+ assign $P0, $P2
+ $I0 = isa $P0, $P1
+ ok( $I0, 'Assign Object with PMC parent to Undef' )
# TODO: Needs tests to verify that the values and metadata are preserved
# across the assignment
.end
+
# Local Variables:
# mode: pir
# fill-column: 100
Modified: branches/pluggable_runcore/t/tools/pmc2c.t
==============================================================================
--- branches/pluggable_runcore/t/tools/pmc2c.t Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/t/tools/pmc2c.t Thu Aug 27 18:38:59 2009 (r40830)
@@ -28,7 +28,7 @@
use Fatal qw{open close};
use Test::More;
-use Parrot::Test tests => 13;
+use Parrot::Test tests => 12;
use Parrot::Config;
my $pmc2c = join $PConfig{slash}, qw(. tools build pmc2c.pl);
@@ -133,19 +133,8 @@
vt_clone->provides_str = CONST_STRING_GEN(interp, "nothing");
END_C
-pmc2c_output_like( <<'END_PMC', <<'END_C', 'need_ext' );
-pmclass a need_ext { }
-END_PMC
- const VTABLE temp_ro_vtable = {
- NULL, /* namespace */
- enum_class_a, /* base_type */
- NULL, /* whoami */
- 0|VTABLE_PMC_NEEDS_EXT|VTABLE_IS_READONLY_FLAG, /* flags */
-END_C
-
}
-
pmc2c_output_like( <<'END_PMC', <<'END_C', 'maps' );
pmclass a hll dale maps Integer { }
END_PMC
Modified: branches/pluggable_runcore/tools/build/nativecall.pl
==============================================================================
--- branches/pluggable_runcore/tools/build/nativecall.pl Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/tools/build/nativecall.pl Thu Aug 27 18:38:59 2009 (r40830)
@@ -405,7 +405,7 @@
/b/ && do {
push @{$temps_ref}, "STRING *t_$temp_num;";
push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_S($reg_num);";
- return "PObj_bufstart(t_$temp_num)";
+ return "Buffer_bufstart(t_$temp_num)";
};
/B/ && do {
push @{$temps_ref}, "char *s_$temp_num;\n char *t_$temp_num;\n void** v_$temp_num = (void **) &t_$temp_num;";
Modified: branches/pluggable_runcore/tools/dev/mk_language_shell.pl
==============================================================================
--- branches/pluggable_runcore/tools/dev/mk_language_shell.pl Thu Aug 27 18:23:46 2009 (r40829)
+++ branches/pluggable_runcore/tools/dev/mk_language_shell.pl Thu Aug 27 18:38:59 2009 (r40830)
@@ -1093,7 +1093,6 @@
provides array
group @lclang at _group
- need_ext
dynpmc
{
/*
More information about the parrot-commits
mailing list