[svn:parrot] r48012 - in branches/gsoc_past_optimization: . compilers/data_json compilers/imcc compilers/pct compilers/pge compilers/pirc/src compilers/tge config/auto/sizes config/auto/zlib config/gen config/gen/makefiles config/gen/platform/ansi config/gen/platform/darwin config/gen/platform/generic config/gen/platform/netbsd config/gen/platform/openbsd config/gen/platform/solaris docs/book/draft docs/book/pct docs/dev docs/pdds docs/project examples/compilers examples/embed examples/languages/abc examples/languages/squaak examples/pge ext/nqp-rx include/parrot lib/Parrot lib/Parrot/Configure/Step lib/Parrot/Test/Util ports/cygwin ports/debian ports/fedora/2.3.0 ports/suse/2.2.0 runtime/parrot/languages runtime/parrot/library runtime/parrot/library/Math src src/call src/dynpmc src/gc src/interp src/io src/ops src/pmc src/runcore src/string/charset t/codingstd t/compilers/tge t/configure t/dynpmc t/oo t/pmc t/postconfigure t/src t/steps/init/hints t/tools tools/buil d tools/dev tools/util
tcurtis at svn.parrot.org
tcurtis at svn.parrot.org
Mon Jul 5 17:14:39 UTC 2010
Author: tcurtis
Date: Mon Jul 5 17:14:37 2010
New Revision: 48012
URL: https://trac.parrot.org/parrot/changeset/48012
Log:
Sync with trunk.
Deleted:
branches/gsoc_past_optimization/config/gen/platform/darwin/memalign.c
branches/gsoc_past_optimization/config/gen/platform/generic/memalign.c
Modified:
branches/gsoc_past_optimization/ (props changed)
branches/gsoc_past_optimization/DEPRECATED.pod
branches/gsoc_past_optimization/MANIFEST
branches/gsoc_past_optimization/compilers/data_json/Rules.mak (props changed)
branches/gsoc_past_optimization/compilers/imcc/Rules.in (props changed)
branches/gsoc_past_optimization/compilers/pct/Rules.mak (props changed)
branches/gsoc_past_optimization/compilers/pge/Rules.mak (props changed)
branches/gsoc_past_optimization/compilers/pirc/src/pircapi.c
branches/gsoc_past_optimization/compilers/tge/Rules.mak (props changed)
branches/gsoc_past_optimization/config/auto/sizes/intval_maxmin_c.in (props changed)
branches/gsoc_past_optimization/config/auto/zlib/ (props changed)
branches/gsoc_past_optimization/config/gen/makefiles/root.in
branches/gsoc_past_optimization/config/gen/platform.pm
branches/gsoc_past_optimization/config/gen/platform/ansi/dl.c
branches/gsoc_past_optimization/config/gen/platform/ansi/exec.c
branches/gsoc_past_optimization/config/gen/platform/ansi/time.c
branches/gsoc_past_optimization/config/gen/platform/generic/dl.c
branches/gsoc_past_optimization/config/gen/platform/generic/exec.c
branches/gsoc_past_optimization/config/gen/platform/generic/math.c
branches/gsoc_past_optimization/config/gen/platform/generic/stat.c
branches/gsoc_past_optimization/config/gen/platform/generic/time.c
branches/gsoc_past_optimization/config/gen/platform/netbsd/math.c
branches/gsoc_past_optimization/config/gen/platform/openbsd/math.c
branches/gsoc_past_optimization/config/gen/platform/solaris/math.c
branches/gsoc_past_optimization/config/gen/platform/solaris/time.c
branches/gsoc_past_optimization/docs/book/draft/README (props changed)
branches/gsoc_past_optimization/docs/book/draft/appa_glossary.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/appb_patch_submission.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/appc_command_line_options.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/appd_build_options.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/appe_source_code.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/ch01_introduction.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/ch02_getting_started.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/ch07_dynpmcs.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/ch08_dynops.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/ch10_opcode_reference.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/ch11_directive_reference.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/ch12_operator_reference.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/chXX_hlls.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/chXX_library.pod (props changed)
branches/gsoc_past_optimization/docs/book/draft/chXX_testing_and_debugging.pod (props changed)
branches/gsoc_past_optimization/docs/book/pct/ch01_introduction.pod (props changed)
branches/gsoc_past_optimization/docs/book/pct/ch02_getting_started.pod (props changed)
branches/gsoc_past_optimization/docs/book/pct/ch03_compiler_tools.pod (props changed)
branches/gsoc_past_optimization/docs/book/pct/ch04_pge.pod (props changed)
branches/gsoc_past_optimization/docs/book/pct/ch05_nqp.pod (props changed)
branches/gsoc_past_optimization/docs/dev/c_functions.pod (props changed)
branches/gsoc_past_optimization/docs/pdds/pdd30_install.pod (props changed)
branches/gsoc_past_optimization/docs/project/release_manager_guide.pod
branches/gsoc_past_optimization/examples/compilers/japhc.c
branches/gsoc_past_optimization/examples/embed/cotorra.c (props changed)
branches/gsoc_past_optimization/examples/languages/abc/ (props changed)
branches/gsoc_past_optimization/examples/languages/squaak/ (props changed)
branches/gsoc_past_optimization/examples/pge/demo.pir (props changed)
branches/gsoc_past_optimization/ext/nqp-rx/Rules.mak (props changed)
branches/gsoc_past_optimization/include/parrot/call.h (props changed)
branches/gsoc_past_optimization/include/parrot/dynext.h
branches/gsoc_past_optimization/include/parrot/extend.h
branches/gsoc_past_optimization/include/parrot/gc_api.h (props changed)
branches/gsoc_past_optimization/include/parrot/runcore_api.h (props changed)
branches/gsoc_past_optimization/include/parrot/runcore_profiling.h (props changed)
branches/gsoc_past_optimization/include/parrot/runcore_trace.h (props changed)
branches/gsoc_past_optimization/lib/Parrot/Configure/Step/Test.pm (props changed)
branches/gsoc_past_optimization/lib/Parrot/H2inc.pm (props changed)
branches/gsoc_past_optimization/lib/Parrot/Test/Util/Runloop.pm
branches/gsoc_past_optimization/ports/cygwin/parrot-1.0.0-1.cygport (props changed)
branches/gsoc_past_optimization/ports/debian/libparrot-dev.install.in (props changed)
branches/gsoc_past_optimization/ports/debian/libparrot.install.in (props changed)
branches/gsoc_past_optimization/ports/debian/parrot-doc.install.in (props changed)
branches/gsoc_past_optimization/ports/debian/parrot.install.in (props changed)
branches/gsoc_past_optimization/ports/fedora/2.3.0/ (props changed)
branches/gsoc_past_optimization/ports/suse/2.2.0/ (props changed)
branches/gsoc_past_optimization/runtime/parrot/languages/ (props changed)
branches/gsoc_past_optimization/runtime/parrot/library/Math/Rand.pir (props changed)
branches/gsoc_past_optimization/runtime/parrot/library/P6object.pir
branches/gsoc_past_optimization/runtime/parrot/library/Pg.pir
branches/gsoc_past_optimization/runtime/parrot/library/Rules.mak (props changed)
branches/gsoc_past_optimization/src/call/ops.c (props changed)
branches/gsoc_past_optimization/src/call/pcc.c (props changed)
branches/gsoc_past_optimization/src/dynext.c
branches/gsoc_past_optimization/src/dynpmc/gziphandle.pmc
branches/gsoc_past_optimization/src/extend.c
branches/gsoc_past_optimization/src/gc/alloc_memory.c (props changed)
branches/gsoc_past_optimization/src/gc/alloc_resources.c (props changed)
branches/gsoc_past_optimization/src/gc/api.c (props changed)
branches/gsoc_past_optimization/src/gc/malloc.c (props changed)
branches/gsoc_past_optimization/src/gc/malloc_trace.c (props changed)
branches/gsoc_past_optimization/src/gc/mark_sweep.c (props changed)
branches/gsoc_past_optimization/src/gc/system.c (props changed)
branches/gsoc_past_optimization/src/interp/inter_cb.c (props changed)
branches/gsoc_past_optimization/src/interp/inter_create.c (props changed)
branches/gsoc_past_optimization/src/interp/inter_misc.c (props changed)
branches/gsoc_past_optimization/src/io/api.c
branches/gsoc_past_optimization/src/ops/core.ops
branches/gsoc_past_optimization/src/ops/core_ops.c
branches/gsoc_past_optimization/src/packfile.c
branches/gsoc_past_optimization/src/pmc/fixedintegerarray.pmc
branches/gsoc_past_optimization/src/pmc/stringhandle.pmc
branches/gsoc_past_optimization/src/pmc/sub.pmc
branches/gsoc_past_optimization/src/runcore/cores.c (props changed)
branches/gsoc_past_optimization/src/runcore/main.c (props changed)
branches/gsoc_past_optimization/src/runcore/profiling.c (props changed)
branches/gsoc_past_optimization/src/runcore/trace.c (props changed)
branches/gsoc_past_optimization/src/string/charset/ascii.c
branches/gsoc_past_optimization/src/string/charset/binary.c
branches/gsoc_past_optimization/src/string/charset/iso-8859-1.c
branches/gsoc_past_optimization/src/string/charset/unicode.c
branches/gsoc_past_optimization/t/codingstd/c_function_docs.t
branches/gsoc_past_optimization/t/compilers/tge/NoneGrammar.tg (props changed)
branches/gsoc_past_optimization/t/configure/017-revision_from_cache.t
branches/gsoc_past_optimization/t/configure/018-revision_to_cache.t
branches/gsoc_past_optimization/t/configure/061-revision_from_cache.t
branches/gsoc_past_optimization/t/dynpmc/gziphandle.t
branches/gsoc_past_optimization/t/oo/root_new.t (props changed)
branches/gsoc_past_optimization/t/pmc/filehandle.t
branches/gsoc_past_optimization/t/pmc/namespace-old.t (props changed)
branches/gsoc_past_optimization/t/postconfigure/05-trace.t
branches/gsoc_past_optimization/t/src/embed.t (props changed)
branches/gsoc_past_optimization/t/steps/init/hints/linux-01.t (props changed)
branches/gsoc_past_optimization/t/tools/pbc_disassemble.t
branches/gsoc_past_optimization/tools/build/h2inc.pl (props changed)
branches/gsoc_past_optimization/tools/dev/fetch_languages.pl (props changed)
branches/gsoc_past_optimization/tools/dev/mk_gitignore.pl (props changed)
branches/gsoc_past_optimization/tools/util/perlcritic-cage.conf (props changed)
Modified: branches/gsoc_past_optimization/DEPRECATED.pod
==============================================================================
--- branches/gsoc_past_optimization/DEPRECATED.pod Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/DEPRECATED.pod Mon Jul 5 17:14:37 2010 (r48012)
@@ -141,12 +141,25 @@
L<https://trac.parrot.org/parrot/ticket/1655>
+=item Method is_tty in PMCs derived from Handle [eligible in 2.7]
+
+Use isatty instead.
+
+L<https://trac.parrot.org/parrot/ticket/1689>
+
=back
=head1 Opcodes
=over 4
+=item open and close opcodes will be removed [eligible in 2.7]
+
+L<https://trac.parrot.org/parrot/ticket/1697>
+
+These opcodes will be removed. The open/close methods on File or
+the FileHandle PMC should be used instead.
+
=item get_addr and set_addr [eligible in 1.5]
L<https://trac.parrot.org/parrot/ticket/218>
Modified: branches/gsoc_past_optimization/MANIFEST
==============================================================================
--- branches/gsoc_past_optimization/MANIFEST Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/MANIFEST Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Sat Jul 3 13:16:41 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Mon Jul 5 17:11:40 2010 UT
#
# See below for documentation on the format of this file.
#
@@ -278,7 +278,6 @@
config/gen/platform/cygwin/math.c []
config/gen/platform/darwin/begin.c []
config/gen/platform/darwin/hires_timer.c []
-config/gen/platform/darwin/memalign.c []
config/gen/platform/generic/dl.c []
config/gen/platform/generic/dl.h []
config/gen/platform/generic/env.c []
@@ -288,7 +287,6 @@
config/gen/platform/generic/itimer.c []
config/gen/platform/generic/math.c []
config/gen/platform/generic/math.h []
-config/gen/platform/generic/memalign.c []
config/gen/platform/generic/memexec.c []
config/gen/platform/generic/platform_limits.h []
config/gen/platform/generic/signal.c []
Modified: branches/gsoc_past_optimization/compilers/pirc/src/pircapi.c
==============================================================================
--- branches/gsoc_past_optimization/compilers/pirc/src/pircapi.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/compilers/pirc/src/pircapi.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -17,6 +17,9 @@
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+/* HEADERIZER END: static */
+
/*
@@ -72,16 +75,14 @@
=item C<void parse_file(PARROT_INTERP, int flexdebug, FILE *infile, char * const
filename, int flags, int thr_id, unsigned macro_size, char * const outputfile)>
-=cut
-
This will be the proper declaration after testing for thread-safety:
void parse_file(int flexdebug, FILE *infile, char * const filename, int flags,
char * const outputfile)
-*/
-
+=cut
+*/
void
parse_file(PARROT_INTERP, int flexdebug, ARGIN(FILE *infile),
@@ -260,6 +261,8 @@
=item C<PackFile_ByteCode * pirc_compile_file(PARROT_INTERP, const char
*filename, STRING **error_message)>
+Returns NULL.
+
=cut
*/
@@ -274,8 +277,6 @@
}
-/* HEADERIZER END: static */
-
/*
Modified: branches/gsoc_past_optimization/config/gen/makefiles/root.in
==============================================================================
--- branches/gsoc_past_optimization/config/gen/makefiles/root.in Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/makefiles/root.in Mon Jul 5 17:14:37 2010 (r48012)
@@ -2563,6 +2563,8 @@
tar -zcv -T - -f parrot-$(VERSION).tar.gz
$(PERL) -lane 'print"parrot-$(VERSION)/$$F[0]"unless!length||/#/' \
MANIFEST | tar -jcv -T - -f parrot-$(VERSION).tar.bz2
+ sha256sum parrot-$(VERSION).tar.gz > parrot-$(VERSION).tar.gz.sha256
+ sha256sum parrot-$(VERSION).tar.bz2 > parrot-$(VERSION).tar.bz2.sha256
mv MANIFEST.real MANIFEST
rm parrot-$(VERSION)
Modified: branches/gsoc_past_optimization/config/gen/platform.pm
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform.pm Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform.pm Mon Jul 5 17:14:37 2010 (r48012)
@@ -191,7 +191,6 @@
dl.c
stat.c
math.c
- memalign.c
signal.c
itimer.c
memexec.c
Modified: branches/gsoc_past_optimization/config/gen/platform/ansi/dl.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/ansi/dl.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/ansi/dl.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2007, Parrot Foundation.
+ * Copyright (C) 2007-2010, Parrot Foundation.
*/
/*
@@ -11,20 +11,16 @@
=head1 DESCRIPTION
-Dynlib stuff. (Currently, just placeholders.)
+Parrot functions -- B<none yet implemented> -- which wrap around standard
+library functions for handling dynamic libraries.
=head2 Functions
=over 4
-=cut
-
-*/
-
-/*
+=item C<void * Parrot_dlopen(const char *filename, Parrot_dlopen_flags flags)>
-=item C<void * Parrot_dlopen(const char *filename, SHIM(Parrot_dlopen_flags
-flags)>
+Parrot wrapper around C<dlopen>. B<Not yet implemented.>
=cut
@@ -42,6 +38,8 @@
=item C<const char * Parrot_dlerror(void)>
+Parrot wrapper around C<dlerror>. B<Not yet implemented.>
+
=cut
*/
@@ -57,6 +55,8 @@
=item C<void * Parrot_dlsym(void *handle, const char *symbol)>
+Parrot wrapper around C<dlsym>. B<Not yet implemented.>
+
=cut
*/
@@ -73,6 +73,8 @@
=item C<int Parrot_dlclose(void *handle)>
+Parrot wrapper around C<dlclose>. B<Not yet implemented.>
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/ansi/exec.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/ansi/exec.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/ansi/exec.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2008, Parrot Foundation.
+ * Copyright (C) 2004-2010, Parrot Foundation.
*/
/*
@@ -25,7 +25,7 @@
=item C<INTVAL Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)>
-Spawn a subprocess
+B<Not yet implemented on this platform.> Spawn a subprocess.
=cut
@@ -43,6 +43,8 @@
=item C<INTVAL Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)>
+B<Not yet implemented on this platform.>
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/ansi/time.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/ansi/time.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/ansi/time.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2007, Parrot Foundation.
+ * Copyright (C) 2007-2010, Parrot Foundation.
*/
/*
@@ -27,6 +27,8 @@
=item C<INTVAL Parrot_intval_time(void)>
+Parrot wrapper around standard library C<time()> function, returning an INTVAL.
+
=cut
*/
@@ -42,6 +44,9 @@
=item C<FLOATVAL Parrot_floatval_time(void)>
+Note: We are unable to provide this level of precision under ANSI-C, so we
+just fall back to intval time for this.
+
=cut
*/
@@ -49,8 +54,6 @@
FLOATVAL
Parrot_floatval_time(void)
{
- /* unable to provide this level of precision under ANSI-C, so just fall
- back to intval time for this. */
Parrot_warn(NULL, PARROT_WARNINGS_PLATFORM_FLAG, "Parrot_floatval_time not accurate");
return (FLOATVAL)Parrot_intval_time();
}
Deleted: branches/gsoc_past_optimization/config/gen/platform/darwin/memalign.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/darwin/memalign.c Mon Jul 5 17:14:37 2010 (r48011)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,201 +0,0 @@
-/*
- * $Id$
- * Copyright (C) 2007-2008, Parrot Foundation.
- */
-
-/*
-
-=head1 NAME
-
-memalign.c
-
-=head1 DESCRIPTION
-
-memalign related stuff
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include <mach/vm_map.h>
-#include <mach/mach_init.h>
-
-/*
-
-=item C<static unsigned long log2int(unsigned long x)>
-
-=cut
-
-*/
-
-static unsigned long log2int(unsigned long x) {
- return (x < 2) ? 0 : log2int(x >> 1) + 1;
-}
-
-/*
-
-=item C<static unsigned long roundDownPowerOf2(unsigned long x)>
-
-=cut
-
-*/
-
-static unsigned long roundDownPowerOf2(unsigned long x) {
- return (1 << log2int(x));
-}
-
-/*
-
-=item C<static unsigned long roundUpPowerOf2(unsigned long x)>
-
-=cut
-
-*/
-
-static unsigned long roundUpPowerOf2(unsigned long x)
-{
- static unsigned long one = 1;
- unsigned long log2Int = log2int(x);
-
- return ((one << log2Int) == x) ? x : (one << (log2Int + 1));
-}
-
-/*
-
-=item C<static unsigned long roundUpToPageBoundary(unsigned long x)>
-
-=cut
-
-*/
-
-static unsigned long roundUpToPageBoundary(unsigned long x)
-{
- unsigned long roundedDown = trunc_page(x);
-
- return (roundedDown == x) ? x : (roundedDown + vm_page_size);
-}
-
-typedef struct _memalign_marker_t {
- vm_address_t start;
- vm_size_t size;
-} memalign_marker_t;
-
-/*
-
-=item C<void * Parrot_memalign(size_t align, size_t size)>
-
-=cut
-
-*/
-
-void *
-Parrot_memalign(size_t align, size_t size)
-{
- size_t effectiveAlign = align;
- size_t padding = 0;
- size_t amountToAllocate = 0;
-
- if (effectiveAlign < sizeof (void *))
- effectiveAlign = roundUpPowerOf2(sizeof (void *));
- else
- effectiveAlign = roundUpPowerOf2(effectiveAlign);
-
- if (effectiveAlign < sizeof (memalign_marker_t))
- padding = sizeof (memalign_marker_t);
- else
- padding = effectiveAlign;
-
- amountToAllocate = roundUpToPageBoundary(size + padding);
-
- {
- vm_address_t p = (vm_address_t)NULL;
- kern_return_t status = vm_allocate(mach_task_self(), &p,
- amountToAllocate, 1);
-
- if (status != KERN_SUCCESS)
- return NULL;
- else {
- vm_size_t logEffectiveAlign = log2int(effectiveAlign);
- vm_address_t lowestAvaliableAddress =
- p + sizeof (memalign_marker_t);
- vm_address_t roundedDownAddress =
- ((lowestAvaliableAddress >> logEffectiveAlign)
- << logEffectiveAlign);
- vm_address_t returnAddress =
- (roundedDownAddress == lowestAvaliableAddress)
- ? lowestAvaliableAddress
- : (roundedDownAddress + effectiveAlign);
- vm_address_t firstUnneededPage = 0;
-
- memalign_marker_t *marker =
- (memalign_marker_t *)returnAddress - 1;
-
- /* lowest address used, then round down to vm_page boundary */
- vm_address_t usedPageBase = trunc_page((vm_address_t)marker);
- marker->start = usedPageBase;
- marker->size = returnAddress + size - usedPageBase;
-
- if (usedPageBase > p) {
- status = vm_deallocate(mach_task_self(), p, usedPageBase - p);
-
- if (status != KERN_SUCCESS)
- fprintf(stderr, "Parrot_memalign(%zx, %zx) failed "
- "to deallocate extra header space.\n",
- align, size);
- }
-
- firstUnneededPage = roundUpToPageBoundary(returnAddress + size);
-
- if (firstUnneededPage < p + amountToAllocate) {
- status = vm_deallocate(mach_task_self(), firstUnneededPage,
- p + amountToAllocate - firstUnneededPage);
-
- if (status != KERN_SUCCESS) {
- fprintf(stderr, "Parrot_memalign(%zx, %zx) failed "
- "to deallocate extra footer space.\n",
- align, size);
- }
- }
-
- return (void *)returnAddress;
- }
- }
-}
-
-/*
-
-=item C<void Parrot_free_memalign(void *p)>
-
-=cut
-
-*/
-
-void
-Parrot_free_memalign(void *p)
-{
- memalign_marker_t *marker = (memalign_marker_t *)p - 1;
- kern_return_t status = vm_deallocate(mach_task_self(),
- marker->start, marker->size);
-
- if (status != KERN_SUCCESS)
- fprintf(stderr, "Parrot_free_memalign(%p) failed!\n", p);
-}
-
-/*
-
-=back
-
-=cut
-
-*/
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Modified: branches/gsoc_past_optimization/config/gen/platform/generic/dl.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/generic/dl.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/generic/dl.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2006, Parrot Foundation.
+ * Copyright (C) 2004-2010, Parrot Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-Dynlib stuff
+Parrot functions which wrap around standard library functions for handling dynamic libraries.
=head2 Functions
@@ -31,6 +31,9 @@
=item C<void * Parrot_dlopen(const char *filename, Parrot_dlopen_flags flags)>
+Parrot wrapper around C<dlopen>. Loads dynamic library file named by first
+argument and returns a handle to it.
+
=cut
*/
@@ -50,6 +53,9 @@
=item C<const char * Parrot_dlerror(void)>
+Wrapper around C<dlerror>. System-dependent string that indicates most recent
+failure in use of C<Parrot_dlopen>, C<Parrot_dlclose> or C<Parrot_dlsym>.
+
=cut
*/
@@ -68,6 +74,9 @@
=item C<void * Parrot_dlsym(void *handle, const char *symbol)>
+Wrapper around C<dlysm>. Takes a handle returned by C<Parrot_dlopen> and
+returns address where symbol is located.
+
=cut
*/
@@ -86,6 +95,9 @@
=item C<int Parrot_dlclose(void *handle)>
+Wrapper around C<dlclose>. Releases reference to dynamic library specified
+by argument. Returns C<0> on success and C<-1> on failure.
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/generic/exec.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/generic/exec.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/generic/exec.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2009, Parrot Foundation.
+ * Copyright (C) 2004-2010, Parrot Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-system() stuff
+Parrot functions to run operating system commands.
=head2 Functions
@@ -28,8 +28,8 @@
=item C<INTVAL Parrot_Run_OS_Command(PARROT_INTERP, STRING *command)>
-Spawn off a subprocess and wait for the damn thing to complete,
-returning the return value of the process
+Spawn off a subprocess provided in a string. Wait for it to complete,
+returning the return value of the process.
=cut
@@ -72,6 +72,9 @@
=item C<INTVAL Parrot_Run_OS_Command_Argv(PARROT_INTERP, PMC *cmdargs)>
+Spawn off a subprocess provided in command-line arguments. Wait for it to
+complete, returning the return value of the process.
+
=cut
*/
@@ -125,6 +128,14 @@
}
/*
+
+=back
+
+=cut
+
+*/
+
+/*
* Local variables:
* c-file-style: "parrot"
* End:
Modified: branches/gsoc_past_optimization/config/gen/platform/generic/math.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/generic/math.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/generic/math.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2007, Parrot Foundation.
+ * Copyright (C) 2004-2010, Parrot Foundation.
*/
/*
@@ -11,29 +11,21 @@
=head1 DESCRIPTION
-math stuff
+Mathematical functions.
=head2 Functions
=over 4
-=cut
-
-*/
-
-/*
-
=item C<extern int Parrot_signbit(double x)>
-return true if the Numval has a negative sign.
+Return true if the Numval has a negative sign.
This is mostly for handling the -0.0 case.
=cut
*/
-/*
- */
#if DOUBLE_SIZE == 2 * INT_SIZE
extern int
Parrot_signbit(double x)
@@ -55,6 +47,8 @@
=item C<int Parrot_signbit_l(long double x)>
+Like C<Parrot_signbit()>, only taking long double instead of double.
+
=cut
*/
Deleted: branches/gsoc_past_optimization/config/gen/platform/generic/memalign.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/generic/memalign.c Mon Jul 5 17:14:37 2010 (r48011)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,94 +0,0 @@
-/*
- * $Id$
- * Copyright (C) 2004-2006, Parrot Foundation.
- */
-
-/*
-
-=head1 NAME
-
-config/gen/platform/generic/memalign.c
-
-=head1 DESCRIPTION
-
-memalign related stuff
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#if defined(PARROT_HAS_POSIX_MEMALIGN)
-# include <stdlib.h>
-
-/*
-
-=item C<void * Parrot_memalign(size_t align, size_t size)>
-
-=cut
-
-*/
-
-void *
-Parrot_memalign(size_t align, size_t size)
-{
- void *p;
- int i = posix_memalign(&p, align, size);
- return i == 0 ? p : NULL;
-}
-
-#elif defined(PARROT_HAS_MEMALIGN)
-
-# if defined(PARROT_HAS_HEADER_MALLOC)
-# include <malloc.h>
-# else
-# include <stdlib.h>
-# endif
-
-/*
-
-=item C<void * Parrot_memalign(size_t align, size_t size)>
-
-=cut
-
-*/
-
-void *
-Parrot_memalign(size_t align, size_t size)
-{
- return memalign(align, size);
-}
-
-#endif
-
-/*
-
-=item C<void Parrot_free_memalign(void *p)>
-
-=cut
-
-*/
-
-void
-Parrot_free_memalign(void *p)
-{
- free(p);
-}
-
-/*
-
-=back
-
-=cut
-
-*/
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Modified: branches/gsoc_past_optimization/config/gen/platform/generic/stat.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/generic/stat.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/generic/stat.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2007-2008, Parrot Foundation.
+ * Copyright (C) 2007-2010, Parrot Foundation.
*/
/*
@@ -26,6 +26,8 @@
=item C<PMC * Parrot_stat_file(PARROT_INTERP, STRING *filename)>
+B<Not implemented.> Returns C<NULL>.
+
=cut
*/
@@ -41,6 +43,8 @@
=item C<PMC * Parrot_stat_info_pmc(PARROT_INTERP, STRING *filename, INTVAL
thing)>
+B<Not implemented.> Returns C<NULL>.
+
=cut
*/
@@ -56,6 +60,55 @@
=item C<static INTVAL stat_common(PARROT_INTERP, struct stat *statbuf, INTVAL
thing, int status)>
+Stats the file, and returns the information specified by C<thing>. C<thing> can
+be one of:
+
+=over 4
+
+=item * C<STAT_EXISTS>
+
+=item * C<STAT_FILESIZE>
+
+=item * C<STAT_ISDIR>
+
+=item * C<STAT_ISREG>
+
+=item * C<STAT_ISDEV>
+
+=item * C<STAT_ACCESSTIME>
+
+=item * C<STAT_MODIFYTIME>
+
+=item * C<STAT_CHANGETIME>
+
+=item * C<STAT_UID>
+
+=item * C<STAT_GID>
+
+=item * C<STAT_PLATFORM_DEV>
+
+=item * C<STAT_PLATFORM_INODE>
+
+=item * C<STAT_PLATFORM_MODE>
+
+=item * C<STAT_PLATFORM_NLINKS>
+
+=item * C<STAT_PLATFORM_DEVTYPE>
+
+=item * C<STAT_PLATFORM_MODE>
+
+=item * C<STAT_PLATFORM_NLINKS>
+
+=item * C<STAT_PLATFORM_DEVTYPE>
+
+=item * C<STAT_PLATFORM_BLOCKSIZE>
+
+=item * C<STAT_PLATFORM_BLOCKS>
+
+=back
+
+C<STAT_CREATETIME> and C<STAT_BACKUPTIME> are not supported and will return C<-1>.
+
=cut
*/
@@ -141,6 +194,8 @@
=item C<INTVAL Parrot_stat_info_intval(PARROT_INTERP, STRING *file, INTVAL
thing)>
+Returns the stat field given by C<thing> of file C<file>.
+
=cut
*/
@@ -164,6 +219,8 @@
=item C<INTVAL Parrot_fstat_info_intval(PARROT_INTERP, INTVAL file, INTVAL
thing)>
+Returns the fstat field given by C<thing> from file identifier C<file>.
+
=cut
*/
@@ -184,6 +241,8 @@
=item C<FLOATVAL Parrot_stat_info_floatval(PARROT_INTERP, STRING *filename,
INTVAL thing)>
+Currently returns C<-1.0> and has no side effects.
+
=cut
*/
@@ -199,6 +258,8 @@
=item C<STRING * Parrot_stat_info_string(PARROT_INTERP, STRING *filename, INTVAL
thing)>
+B<Not implemented.> Returns C<NULL>.
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/generic/time.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/generic/time.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/generic/time.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2006, Parrot Foundation.
+ * Copyright (C) 2004-2010, Parrot Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-Time stuff
+Parrot time-related functions.
=head2 Functions
@@ -28,6 +28,8 @@
=item C<INTVAL Parrot_intval_time(void)>
+Parrot wrapper around standard library C<time()> function, returning an INTVAL.
+
=cut
*/
@@ -43,6 +45,8 @@
=item C<FLOATVAL Parrot_floatval_time(void)>
+Parrot wrapper around standard library C<time()> function, returning a FLOATVAL.
+
=cut
*/
@@ -59,6 +63,8 @@
=item C<void Parrot_sleep(unsigned int seconds)>
+Parrot wrapper around standard library C<sleep()> function.
+
=cut
*/
@@ -90,6 +96,8 @@
=item C<struct tm * Parrot_gmtime_r(const time_t *t, struct tm *tm)>
+Parrot wrapper around standard library C<gmtime_r()> function.
+
=cut
*/
@@ -105,6 +113,8 @@
=item C<struct tm * Parrot_localtime_r(const time_t *t, struct tm *tm)>
+Parrot wrapper around standard library C<localtime_r()> function.
+
=cut
*/
@@ -120,6 +130,8 @@
=item C<char* Parrot_asctime_r(const struct tm *tm, char *buffer)>
+Parrot wrapper around standard library C<asctime_r()> function.
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/netbsd/math.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/netbsd/math.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/netbsd/math.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,7 +1,7 @@
/* $Id$ */
/*
- * Copyright (C) 2006-2007, Parrot Foundation.
+ * Copyright (C) 2006-2010, Parrot Foundation.
*/
/*
@@ -12,7 +12,7 @@
=head1 DESCRIPTION
-math stuff
+Mathematical functions.
=head2 Functions
@@ -29,7 +29,7 @@
=item C<extern int Parrot_signbit(double x)>
-return true if the Numval has a negative sign.
+Return true if the Numval has a negative sign.
This is mostly for handling the -0.0 case.
=cut
@@ -57,6 +57,8 @@
=item C<int Parrot_signbit_l(long double x)>
+Like C<Parrot_signbit()>, only taking long double instead of double.
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/openbsd/math.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/openbsd/math.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/openbsd/math.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2006-2007, Parrot Foundation.
+ * Copyright (C) 2006-2010, Parrot Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-math stuff
+Mathematical functions.
=head2 Functions
@@ -37,7 +37,7 @@
=item C<extern int Parrot_signbit(double x)>
-return true if the Numval has a negative sign.
+Return true if the Numval has a negative sign.
This is mostly for handling the -0.0 case.
=cut
@@ -65,6 +65,8 @@
=item C<int Parrot_signbit_l(long double x)>
+Like C<Parrot_signbit()>, only taking long double instead of double.
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/solaris/math.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/solaris/math.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/solaris/math.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2006-2007, Parrot Foundation.
+ * Copyright (C) 2006-2010, Parrot Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-math stuff
+Mathematical functions.
=head2 Functions
@@ -35,7 +35,7 @@
=item C<extern int Parrot_signbit(double x)>
-return true if the Numval has a negative sign.
+Return true if the Numval has a negative sign.
This is mostly for handling the -0.0 case.
=cut
@@ -63,6 +63,8 @@
=item C<int Parrot_signbit_l(long double x)>
+Like C<Parrot_signbit()>, only taking long double instead of double.
+
=cut
*/
Modified: branches/gsoc_past_optimization/config/gen/platform/solaris/time.c
==============================================================================
--- branches/gsoc_past_optimization/config/gen/platform/solaris/time.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/config/gen/platform/solaris/time.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -1,6 +1,6 @@
/*
* $Id$
- * Copyright (C) 2004-2006, Parrot Foundation.
+ * Copyright (C) 2004-2010, Parrot Foundation.
*/
/*
@@ -11,7 +11,7 @@
=head1 DESCRIPTION
-Time stuff
+Parrot time-related functions.
=head2 Functions
@@ -28,6 +28,8 @@
=item C<INTVAL Parrot_intval_time(void)>
+Parrot wrapper around standard library C<time()> function, returning an INTVAL.
+
=cut
*/
@@ -43,6 +45,8 @@
=item C<FLOATVAL Parrot_floatval_time(void)>
+Parrot wrapper around standard library C<time()> function, returning a FLOATVAL.
+
=cut
*/
@@ -59,6 +63,8 @@
=item C<void Parrot_sleep(unsigned int seconds)>
+Parrot wrapper around standard library C<sleep()> function.
+
=cut
*/
@@ -90,6 +96,8 @@
=item C<struct tm * Parrot_gmtime_r(const time_t *t, struct tm *tm)>
+Parrot wrapper around standard library C<gmtime_r()> function.
+
=cut
*/
@@ -105,6 +113,8 @@
=item C<struct tm * Parrot_localtime_r(const time_t *t, struct tm *tm)>
+Parrot wrapper around standard library C<localtime_r()> function.
+
=cut
*/
@@ -120,6 +130,8 @@
=item C<char* Parrot_asctime_r(const struct tm *tm, char *buffer)>
+Parrot wrapper around standard library C<asctime_r()> function.
+
=cut
*/
Modified: branches/gsoc_past_optimization/docs/project/release_manager_guide.pod
==============================================================================
--- branches/gsoc_past_optimization/docs/project/release_manager_guide.pod Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/docs/project/release_manager_guide.pod Mon Jul 5 17:14:37 2010 (r48012)
@@ -231,9 +231,11 @@
$ mkdir ~/ftp/releases/supported/a.b.c
-Copy the different compressed tarballs from your machine into the new directory.
+Copy the different compressed tarballs and the according checksum files from
+your machine into the new directory.
$ scp parrot-a.b.c.tar.gz parrot-a.b.c.tar.bz2 \
+ parrot-a.b.c.tar.gz.sha256 parrot-a.b.c.tar.bz2.sha256 \
<USERNAME>@ftp-osl.osuosl.org:~/ftp/releases/devel/a.b.c/.
(Or using C<wget> or whatever tool you prefer.)
Modified: branches/gsoc_past_optimization/examples/compilers/japhc.c
==============================================================================
--- branches/gsoc_past_optimization/examples/compilers/japhc.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/examples/compilers/japhc.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -69,6 +69,8 @@
=item C<static int unescape(char *string)>
+Unescape a string.
+
=cut
*/
Modified: branches/gsoc_past_optimization/include/parrot/dynext.h
==============================================================================
--- branches/gsoc_past_optimization/include/parrot/dynext.h Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/include/parrot/dynext.h Mon Jul 5 17:14:37 2010 (r48012)
@@ -32,6 +32,13 @@
FUNC_MODIFIES(*s);
PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+void * Parrot_dlsym_str(PARROT_INTERP,
+ ARGIN_NULLOK(void *handle),
+ ARGIN_NULLOK(STRING *symbol))
+ __attribute__nonnull__(1);
+
+PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_init_lib(PARROT_INTERP,
NULLOK(dynext_load_func load_func),
@@ -50,6 +57,8 @@
PARROT_ASSERT_ARG(d) \
, PARROT_ASSERT_ARG(s) \
, PARROT_ASSERT_ARG(lib_pmc))
+#define ASSERT_ARGS_Parrot_dlsym_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_init_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_load_lib __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
Modified: branches/gsoc_past_optimization/include/parrot/extend.h
==============================================================================
--- branches/gsoc_past_optimization/include/parrot/extend.h Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/include/parrot/extend.h Mon Jul 5 17:14:37 2010 (r48012)
@@ -73,8 +73,10 @@
__attribute__nonnull__(3);
PARROT_EXPORT
+PARROT_PURE_FUNCTION
PARROT_WARN_UNUSED_RESULT
-Parrot_Language Parrot_find_language(SHIM_INTERP, SHIM(char *language));
+Parrot_Language Parrot_find_language(SHIM_INTERP,
+ SHIM(const char *language));
PARROT_EXPORT
int Parrot_fprintf(PARROT_INTERP,
@@ -89,22 +91,27 @@
void Parrot_free_cstring(ARGFREE(char *string));
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_Int Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)
__attribute__nonnull__(1);
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_Float Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)
__attribute__nonnull__(1);
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_PMC Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)
__attribute__nonnull__(1);
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_PMC Parrot_get_root_namespace(PARROT_INTERP)
__attribute__nonnull__(1);
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_String Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)
__attribute__nonnull__(1);
@@ -127,6 +134,7 @@
__attribute__nonnull__(1);
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_PMC Parrot_PMC_null(void);
PARROT_EXPORT
Modified: branches/gsoc_past_optimization/lib/Parrot/Test/Util/Runloop.pm
==============================================================================
--- branches/gsoc_past_optimization/lib/Parrot/Test/Util/Runloop.pm Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/lib/Parrot/Test/Util/Runloop.pm Mon Jul 5 17:14:37 2010 (r48012)
@@ -19,18 +19,19 @@
=head1 DESCRIPTION
This module provides a basic runloop for test scripts which perform the same
-test, over and over, on lots of files. It is intended to consolidate some code
-to handle loops, skips etc, replicated many times in the t/distro/ and
-t/codingstd/ test directories.
+test, over and over, on lots of files. It is intended to consolidate some
+code to handle loops, skips etc, replicated many times in the F<t/distro/> and
+F<t/codingstd/> test directories.
You can specify a callback routine to get called back once per line (with the
-per_line attribute), or once per file (with the per_file attribute). The
-per_line callback gets passed the line as a text string. The per_file callback
-gets passed the whole file as a text string. If the callback function returns
-positive, the test passed, otherwise the test failed. Failures are tallied,
-and later reported to the test harness once, as a single test. On failure,
-some informational diagnostics are also generated, showing the user which
-file(s) and which line(s) (if applicable) had the failure.
+C<per_line> attribute), or once per file (with the C<per_file> attribute).
+The C<per_line> callback gets passed the line as a text string. The
+C<per_file> callback gets passed the whole file as a text string. If the
+callback function returns positive, the test passed, otherwise the test
+failed. Failures are tallied, and later reported to the test harness once, as
+a single test. On failure, some informational diagnostics are also generated,
+showing the user which file(s) and which line(s) (if applicable) had the
+failure.
=head1 AUTHOR
Modified: branches/gsoc_past_optimization/runtime/parrot/library/P6object.pir
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/P6object.pir Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/runtime/parrot/library/P6object.pir Mon Jul 5 17:14:37 2010 (r48012)
@@ -111,7 +111,8 @@
.sub 'WHAT' :method :nsentry
.local pmc how, what
how = self.'HOW'()
- .tailcall how.'WHAT'()
+ what = getattribute how, 'protoobject'
+ .return (what)
.end
@@ -162,25 +163,13 @@
=over
-=item WHAT()
-
-Return the protoobject for this metaclass.
-
-=cut
-
-.namespace ['P6metaclass']
-
-.sub 'WHAT' :method :nsentry
- $P0 = getattribute self, 'protoobject'
- .return ($P0)
-.end
-
=item isa(x)
Return a true value if the invocant 'isa' C<x>.
=cut
+.namespace ['P6metaclass']
.sub 'isa' :method :multi(_,_, _)
.param pmc obj
.param pmc x
Modified: branches/gsoc_past_optimization/runtime/parrot/library/Pg.pir
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/Pg.pir Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/runtime/parrot/library/Pg.pir Mon Jul 5 17:14:37 2010 (r48012)
@@ -8,7 +8,7 @@
=head1 SYNOPSIS
.local pmc pg, con, res
- pg = get_class 'Pg'
+ pg = new 'Pg'
con = pg.'connectdb'('dbname = db')
res = con.'exec'('SELECT * from tab')
n = res.'ntuples'()
@@ -40,6 +40,7 @@
## TODO generate includes from libpq-fe.h
## .include 'postgres.pasm'
+.HLL 'parrot'
.const int CONNECTION_OK = 0
.sub __load :load
@@ -61,7 +62,7 @@
=item con = Pg::connectdb('var=val var=val ...')
-A class method that returns a new connection object.
+A method that returns a new connection object.
=back
Modified: branches/gsoc_past_optimization/src/dynext.c
==============================================================================
--- branches/gsoc_past_optimization/src/dynext.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/dynext.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -413,6 +413,36 @@
/*
+=item C<void * Parrot_dlsym_str(PARROT_INTERP, void *handle, STRING *symbol)>
+
+Same as Parrot_dlsym but takes the symbol name from a Parrot String instead
+of a C string.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+void *
+Parrot_dlsym_str(PARROT_INTERP,
+ ARGIN_NULLOK(void *handle), ARGIN_NULLOK(STRING *symbol))
+{
+ ASSERT_ARGS(Parrot_dlsym_str)
+
+ void *ptr;
+ if (STRING_IS_NULL(symbol))
+ ptr = NULL;
+ else {
+ char *const symbol_cs = Parrot_str_to_cstring(interp, symbol);
+ ptr = Parrot_dlsym(handle, symbol_cs);
+ Parrot_str_free_cstring(symbol_cs);
+ }
+ return ptr;
+}
+
+/*
+
=item C<static PMC * run_init_lib(PARROT_INTERP, void *handle, STRING *lib_name,
STRING *wo_ext)>
@@ -453,18 +483,14 @@
"Parrot_lib_%Ss_load", lib_name);
STRING * const init_func_name = Parrot_sprintf_c(interp,
"Parrot_lib_%Ss_init", lib_name);
- char * const cload_func_name = Parrot_str_to_cstring(interp, load_name);
- char * const cinit_func_name = Parrot_str_to_cstring(interp, init_func_name);
/* get load_func */
- void * dlsymfunc = Parrot_dlsym(handle, cload_func_name);
+ void * dlsymfunc = Parrot_dlsym_str(interp, handle, load_name);
load_func = (PMC * (*)(PARROT_INTERP)) D2FPTR(dlsymfunc);
- Parrot_str_free_cstring(cload_func_name);
/* get init_func */
- dlsymfunc = Parrot_dlsym(handle, cinit_func_name);
+ dlsymfunc = Parrot_dlsym_str(interp, handle, init_func_name);
init_func = (void (*)(PARROT_INTERP, PMC *)) D2FPTR(dlsymfunc);
- Parrot_str_free_cstring(cinit_func_name);
}
else {
load_func = NULL;
Modified: branches/gsoc_past_optimization/src/dynpmc/gziphandle.pmc
==============================================================================
--- branches/gsoc_past_optimization/src/dynpmc/gziphandle.pmc Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/dynpmc/gziphandle.pmc Mon Jul 5 17:14:37 2010 (r48012)
@@ -27,7 +27,7 @@
/* HEADERIZER BEGIN: static */
/* HEADERIZER END: static */
-pmclass GzipHandle provides Handle dynpmc auto_attrs {
+pmclass GzipHandle extends Handle dynpmc auto_attrs {
ATTR void *file;
/*
@@ -224,6 +224,8 @@
*/
METHOD is_tty() {
+ Parrot_warn_deprecated(INTERP,
+ "'is_tty' is deprecated, use 'isatty' instead - TT #1689");
RETURN(INTVAL 0);
}
Modified: branches/gsoc_past_optimization/src/extend.c
==============================================================================
--- branches/gsoc_past_optimization/src/extend.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/extend.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -180,6 +180,7 @@
*/
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_PMC
Parrot_get_root_namespace(PARROT_INTERP)
{
@@ -243,6 +244,7 @@
*/
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_PMC
Parrot_PMC_null(void)
{
@@ -337,6 +339,7 @@
*/
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_Int
Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)
{
@@ -355,6 +358,7 @@
*/
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_Float
Parrot_get_numreg(PARROT_INTERP, Parrot_Int regnum)
{
@@ -373,6 +377,7 @@
*/
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_String
Parrot_get_strreg(PARROT_INTERP, Parrot_Int regnum)
{
@@ -391,6 +396,7 @@
*/
PARROT_EXPORT
+PARROT_PURE_FUNCTION
Parrot_PMC
Parrot_get_pmcreg(PARROT_INTERP, Parrot_Int regnum)
{
@@ -513,7 +519,8 @@
/*
-=item C<Parrot_Language Parrot_find_language(PARROT_INTERP, char *language)>
+=item C<Parrot_Language Parrot_find_language(PARROT_INTERP, const char
+*language)>
Find the magic language token for a language, by language name.
@@ -522,9 +529,10 @@
*/
PARROT_EXPORT
+PARROT_PURE_FUNCTION
PARROT_WARN_UNUSED_RESULT
Parrot_Language
-Parrot_find_language(SHIM_INTERP, SHIM(char *language))
+Parrot_find_language(SHIM_INTERP, SHIM(const char *language))
{
ASSERT_ARGS(Parrot_find_language)
return 0;
Modified: branches/gsoc_past_optimization/src/io/api.c
==============================================================================
--- branches/gsoc_past_optimization/src/io/api.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/io/api.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -20,8 +20,8 @@
is used in Parrot ops.
TODO: Where possible, extract some of the filehandle-related details into
-src/io/filehandle.c, and extract the stringhandle details into
-src/io/io_string.c.
+F<src/io/filehandle.c>, and extract the stringhandle details into
+a new F<src/io/io_string.c>.
=cut
Modified: branches/gsoc_past_optimization/src/ops/core.ops
==============================================================================
--- branches/gsoc_past_optimization/src/ops/core.ops Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/ops/core.ops Mon Jul 5 17:14:37 2010 (r48012)
@@ -1253,7 +1253,6 @@
}
op dlfunc(out PMC, invar PMC, in STR, in STR) {
- char * const name = Parrot_str_to_cstring(interp, ($3));
void *dl_handle = NULL;
void *ptr = NULL;
funcptr_t p;
@@ -1264,24 +1263,22 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data($2))->dl_handle;
}
- ptr = Parrot_dlsym(dl_handle, name);
+ ptr = Parrot_dlsym_str(interp, dl_handle, $3);
p = D2FPTR(ptr);
if (p == NULLfunc) {
const char * err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", $3, err ? err : "unknown reason");
$1 = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
$1 = Parrot_pmc_new(interp, enum_class_NCI);
VTABLE_set_pointer_keyed_str(interp, $1, $4, F2DPTR(p));
}
- Parrot_str_free_cstring(name);
}
op dlvar(out PMC, invar PMC, in STR) {
- char * const name = Parrot_str_to_cstring(interp, ($3));
void * dl_handle = NULL;
void * p = NULL;
@@ -1291,12 +1288,12 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data($2))->dl_handle;
}
- p = Parrot_dlsym(dl_handle, name);
+ p = Parrot_dlsym_str(interp, dl_handle, $3);
if (p == NULL) {
const char * const err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", $3, err ? err : "unknown reason");
$1 = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
@@ -1305,7 +1302,6 @@
$1 = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, $1, p);
}
- Parrot_str_free_cstring(name);
}
inline op compreg(in STR, invar PMC) {
Modified: branches/gsoc_past_optimization/src/ops/core_ops.c
==============================================================================
--- branches/gsoc_past_optimization/src/ops/core_ops.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/ops/core_ops.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -15126,7 +15126,6 @@
opcode_t *
Parrot_dlfunc_p_p_s_s(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- char * const name = Parrot_str_to_cstring(interp, (SREG(3)));
void *dl_handle = NULL;
void *ptr = NULL;
funcptr_t p;
@@ -15137,27 +15136,25 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data(PREG(2)))->dl_handle;
}
- ptr = Parrot_dlsym(dl_handle, name);
+ ptr = Parrot_dlsym_str(interp, dl_handle, SREG(3));
p = D2FPTR(ptr);
if (p == NULLfunc) {
const char * err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", SREG(3), err ? err : "unknown reason");
PREG(1) = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
PREG(1) = Parrot_pmc_new(interp, enum_class_NCI);
VTABLE_set_pointer_keyed_str(interp, PREG(1), SREG(4), F2DPTR(p));
}
- Parrot_str_free_cstring(name);
return (opcode_t *)cur_opcode + 5;}
opcode_t *
Parrot_dlfunc_p_p_sc_s(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- char * const name = Parrot_str_to_cstring(interp, (CONST(3)->u.string));
void *dl_handle = NULL;
void *ptr = NULL;
funcptr_t p;
@@ -15168,27 +15165,25 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data(PREG(2)))->dl_handle;
}
- ptr = Parrot_dlsym(dl_handle, name);
+ ptr = Parrot_dlsym_str(interp, dl_handle, CONST(3)->u.string);
p = D2FPTR(ptr);
if (p == NULLfunc) {
const char * err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", CONST(3)->u.string, err ? err : "unknown reason");
PREG(1) = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
PREG(1) = Parrot_pmc_new(interp, enum_class_NCI);
VTABLE_set_pointer_keyed_str(interp, PREG(1), SREG(4), F2DPTR(p));
}
- Parrot_str_free_cstring(name);
return (opcode_t *)cur_opcode + 5;}
opcode_t *
Parrot_dlfunc_p_p_s_sc(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- char * const name = Parrot_str_to_cstring(interp, (SREG(3)));
void *dl_handle = NULL;
void *ptr = NULL;
funcptr_t p;
@@ -15199,27 +15194,25 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data(PREG(2)))->dl_handle;
}
- ptr = Parrot_dlsym(dl_handle, name);
+ ptr = Parrot_dlsym_str(interp, dl_handle, SREG(3));
p = D2FPTR(ptr);
if (p == NULLfunc) {
const char * err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", SREG(3), err ? err : "unknown reason");
PREG(1) = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
PREG(1) = Parrot_pmc_new(interp, enum_class_NCI);
VTABLE_set_pointer_keyed_str(interp, PREG(1), CONST(4)->u.string, F2DPTR(p));
}
- Parrot_str_free_cstring(name);
return (opcode_t *)cur_opcode + 5;}
opcode_t *
Parrot_dlfunc_p_p_sc_sc(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- char * const name = Parrot_str_to_cstring(interp, (CONST(3)->u.string));
void *dl_handle = NULL;
void *ptr = NULL;
funcptr_t p;
@@ -15230,27 +15223,25 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data(PREG(2)))->dl_handle;
}
- ptr = Parrot_dlsym(dl_handle, name);
+ ptr = Parrot_dlsym_str(interp, dl_handle, CONST(3)->u.string);
p = D2FPTR(ptr);
if (p == NULLfunc) {
const char * err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", CONST(3)->u.string, err ? err : "unknown reason");
PREG(1) = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
PREG(1) = Parrot_pmc_new(interp, enum_class_NCI);
VTABLE_set_pointer_keyed_str(interp, PREG(1), CONST(4)->u.string, F2DPTR(p));
}
- Parrot_str_free_cstring(name);
return (opcode_t *)cur_opcode + 5;}
opcode_t *
Parrot_dlvar_p_p_s(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- char * const name = Parrot_str_to_cstring(interp, (SREG(3)));
void * dl_handle = NULL;
void * p = NULL;
@@ -15260,12 +15251,12 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data(PREG(2)))->dl_handle;
}
- p = Parrot_dlsym(dl_handle, name);
+ p = Parrot_dlsym_str(interp, dl_handle, SREG(3));
if (p == NULL) {
const char * const err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", SREG(3), err ? err : "unknown reason");
PREG(1) = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
@@ -15274,14 +15265,12 @@
PREG(1) = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, PREG(1), p);
}
- Parrot_str_free_cstring(name);
return (opcode_t *)cur_opcode + 4;}
opcode_t *
Parrot_dlvar_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) {
const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx);
- char * const name = Parrot_str_to_cstring(interp, (CONST(3)->u.string));
void * dl_handle = NULL;
void * p = NULL;
@@ -15291,12 +15280,12 @@
dl_handle = ((Parrot_ParrotLibrary_attributes*)PMC_data(PREG(2)))->dl_handle;
}
- p = Parrot_dlsym(dl_handle, name);
+ p = Parrot_dlsym_str(interp, dl_handle, CONST(3)->u.string);
if (p == NULL) {
const char * const err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
- "Symbol '%s' not found: %s\n", name, err ? err : "unknown reason");
+ "Symbol '%Ss' not found: %s\n", CONST(3)->u.string, err ? err : "unknown reason");
PREG(1) = Parrot_pmc_new(interp, enum_class_Undef);
}
else {
@@ -15305,7 +15294,6 @@
PREG(1) = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, PREG(1), p);
}
- Parrot_str_free_cstring(name);
return (opcode_t *)cur_opcode + 4;}
Modified: branches/gsoc_past_optimization/src/packfile.c
==============================================================================
--- branches/gsoc_past_optimization/src/packfile.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/packfile.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -3313,7 +3313,8 @@
=item C<static size_t fixup_packed_size(PARROT_INTERP, PackFile_Segment *self)>
-I<What does this do?>
+Calculates the size, in multiples of C<opcode_t>, required to store the
+passed C<PackFile_FixupTable> in bytecode.
=cut
Modified: branches/gsoc_past_optimization/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/gsoc_past_optimization/src/pmc/fixedintegerarray.pmc Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/pmc/fixedintegerarray.pmc Mon Jul 5 17:14:37 2010 (r48012)
@@ -23,13 +23,20 @@
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
-static int auxcmpfunc(const INTVAL *i, const INTVAL *j);
-#define ASSERT_ARGS_auxcmpfunc __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+PARROT_PURE_FUNCTION
+static int auxcmpfunc(ARGIN(const INTVAL *i), ARGIN(const INTVAL *j))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_auxcmpfunc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+ PARROT_ASSERT_ARG(i) \
+ , PARROT_ASSERT_ARG(j))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+PARROT_PURE_FUNCTION
static int
-auxcmpfunc(const INTVAL *i, const INTVAL *j)
+auxcmpfunc(ARGIN(const INTVAL *i), ARGIN(const INTVAL *j))
{
ASSERT_ARGS(auxcmpfunc)
return *i - *j;
@@ -545,8 +552,8 @@
return 0;
for (j = 0; j < n; ++j) {
- INTVAL item1 = SELF.get_integer_keyed_int(j);
- INTVAL item2 = VTABLE_get_integer_keyed_int(INTERP, value, j);
+ const INTVAL item1 = SELF.get_integer_keyed_int(j);
+ const INTVAL item2 = VTABLE_get_integer_keyed_int(INTERP, value, j);
if (item1 != item2)
return 0;
Modified: branches/gsoc_past_optimization/src/pmc/stringhandle.pmc
==============================================================================
--- branches/gsoc_past_optimization/src/pmc/stringhandle.pmc Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/pmc/stringhandle.pmc Mon Jul 5 17:14:37 2010 (r48012)
@@ -222,6 +222,8 @@
*/
METHOD is_tty() {
+ Parrot_warn_deprecated(INTERP,
+ "'is_tty' is deprecated, use 'isatty' instead - TT #1689");
RETURN(INTVAL 0);
}
Modified: branches/gsoc_past_optimization/src/pmc/sub.pmc
==============================================================================
--- branches/gsoc_past_optimization/src/pmc/sub.pmc Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/pmc/sub.pmc Mon Jul 5 17:14:37 2010 (r48012)
@@ -185,8 +185,19 @@
/* comp_flags is actually UINTVAL */
field = CONST_STRING(INTERP, "comp_flags");
- if (VTABLE_exists_keyed_str(INTERP, init, field))
- attrs->comp_flags = (UINTVAL)VTABLE_get_integer_keyed_str(INTERP, init, field);
+ if (VTABLE_exists_keyed_str(INTERP, init, field)) {
+ UINTVAL flags = (UINTVAL)VTABLE_get_integer_keyed_str(INTERP, init, field);
+ /* Mask comp flags only */
+ attrs->comp_flags = flags & SUB_COMP_FLAG_MASK;
+ }
+
+ /* In order to create Sub dynamicaly we have to set PObj flags */
+ field = CONST_STRING(INTERP, "pf_flags");
+ if (VTABLE_exists_keyed_str(INTERP, init, field)) {
+ UINTVAL flags = (UINTVAL)VTABLE_get_integer_keyed_str(INTERP, init, field);
+ /* Mask Sub specific flags only */
+ PObj_get_FLAGS(SELF) |= flags & SUB_FLAG_PF_MASK;
+ }
field = CONST_STRING(INTERP, "n_regs_used");
if (VTABLE_exists_keyed_str(INTERP, init, field)) {
@@ -1125,6 +1136,31 @@
RETURN(INTVAL arity);
}
+
+/*
+=item C<INTVAL comp_flags()>
+
+=item C<INTVAL pf_flags()>
+
+(Experimental) Returns Sub flags.
+
+=cut
+*/
+ METHOD comp_flags() {
+ Parrot_Sub_attributes *sub;
+ INTVAL flags;
+
+ PMC_get_sub(INTERP, SELF, sub);
+ flags = sub->comp_flags;
+ RETURN(INTVAL flags);
+ }
+
+ METHOD pf_flags() {
+ /* Only PF specific flags */
+ INTVAL flags = PObj_get_FLAGS(SELF) & SUB_FLAG_PF_MASK;
+ RETURN(INTVAL flags);
+ }
+
}
Modified: branches/gsoc_past_optimization/src/string/charset/ascii.c
==============================================================================
--- branches/gsoc_past_optimization/src/string/charset/ascii.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/string/charset/ascii.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -678,6 +678,8 @@
=item C<static INTVAL is_cclass(PARROT_INTERP, INTVAL flags, const STRING *src,
UINTVAL offset)>
+Returns Boolean.
+
=cut
*/
@@ -729,6 +731,8 @@
=item C<static INTVAL find_not_cclass(PARROT_INTERP, INTVAL flags, const STRING
*src, UINTVAL offset, UINTVAL count)>
+Returns C<INTVAL>.
+
=cut
*/
@@ -883,6 +887,14 @@
}
/*
+
+=back
+
+=cut
+
+*/
+
+/*
* Local variables:
* c-file-style: "parrot"
* End:
Modified: branches/gsoc_past_optimization/src/string/charset/binary.c
==============================================================================
--- branches/gsoc_past_optimization/src/string/charset/binary.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/string/charset/binary.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -407,6 +407,8 @@
=item C<static INTVAL is_cclass(PARROT_INTERP, INTVAL flags, const STRING *src,
UINTVAL offset)>
+Returns Boolean.
+
=cut
*/
@@ -423,6 +425,8 @@
=item C<static INTVAL find_cclass(PARROT_INTERP, INTVAL flags, const STRING
*src, UINTVAL offset, UINTVAL count)>
+Find a character in the given character class.
+
=cut
*/
@@ -440,6 +444,8 @@
=item C<static INTVAL find_not_cclass(PARROT_INTERP, INTVAL flags, const STRING
*src, UINTVAL offset, UINTVAL count)>
+Returns C<INTVAL>.
+
=cut
*/
@@ -456,6 +462,9 @@
=item C<static STRING * string_from_codepoint(PARROT_INTERP, UINTVAL codepoint)>
+Creates a new STRING object from a single codepoint C<codepoint>. Returns
+the new STRING.
+
=cut
*/
Modified: branches/gsoc_past_optimization/src/string/charset/iso-8859-1.c
==============================================================================
--- branches/gsoc_past_optimization/src/string/charset/iso-8859-1.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/string/charset/iso-8859-1.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -541,6 +541,8 @@
=item C<static INTVAL is_cclass(PARROT_INTERP, INTVAL flags, const STRING *src,
UINTVAL offset)>
+Returns Boolean.
+
=cut
*/
@@ -591,6 +593,8 @@
=item C<static INTVAL find_not_cclass(PARROT_INTERP, INTVAL flags, const STRING
*src, UINTVAL offset, UINTVAL count)>
+Returns C<INTVAL>.
+
=cut
*/
Modified: branches/gsoc_past_optimization/src/string/charset/unicode.c
==============================================================================
--- branches/gsoc_past_optimization/src/string/charset/unicode.c Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/src/string/charset/unicode.c Mon Jul 5 17:14:37 2010 (r48012)
@@ -738,6 +738,8 @@
=item C<static int u_iscclass(PARROT_INTERP, UINTVAL codepoint, INTVAL flags)>
+Returns Boolean.
+
=cut
*/
@@ -834,6 +836,8 @@
=item C<static INTVAL is_cclass(PARROT_INTERP, INTVAL flags, const STRING *src,
UINTVAL offset)>
+Returns Boolean.
+
=cut
*/
@@ -861,6 +865,8 @@
=item C<static INTVAL find_cclass(PARROT_INTERP, INTVAL flags, const STRING
*src, UINTVAL offset, UINTVAL count)>
+Find a character in the given character class.
+
=cut
*/
@@ -901,6 +907,8 @@
=item C<static INTVAL find_not_cclass(PARROT_INTERP, INTVAL flags, const STRING
*src, UINTVAL offset, UINTVAL count)>
+Returns C<INTVAL>.
+
=cut
*/
Modified: branches/gsoc_past_optimization/t/codingstd/c_function_docs.t
==============================================================================
--- branches/gsoc_past_optimization/t/codingstd/c_function_docs.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/codingstd/c_function_docs.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -91,28 +91,6 @@
}
__DATA__
-compilers/pirc/src/pircapi.c
-config/gen/platform/ansi/dl.c
-config/gen/platform/ansi/exec.c
-config/gen/platform/ansi/time.c
-config/gen/platform/darwin/memalign.c
-config/gen/platform/generic/dl.c
-config/gen/platform/generic/exec.c
-config/gen/platform/generic/math.c
-config/gen/platform/generic/memalign.c
-config/gen/platform/generic/stat.c
-config/gen/platform/generic/time.c
-config/gen/platform/netbsd/math.c
-config/gen/platform/openbsd/math.c
-config/gen/platform/solaris/math.c
-config/gen/platform/solaris/time.c
-examples/compilers/japhc.c
-src/gc/generational_ms.c
-src/io/io_string.c
-src/string/charset/ascii.c
-src/string/charset/binary.c
-src/string/charset/iso-8859-1.c
-src/string/charset/unicode.c
# Local Variables:
# mode: cperl
Modified: branches/gsoc_past_optimization/t/configure/017-revision_from_cache.t
==============================================================================
--- branches/gsoc_past_optimization/t/configure/017-revision_from_cache.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/configure/017-revision_from_cache.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -7,10 +7,13 @@
use warnings;
use Test::More;
-plan( skip_all =>
- "\nRelevant only when working in checkout from repository and during configuration" )
- unless (-e 'DEVELOPING' and ! -e 'Makefile');
-plan( tests => 7 );
+if (-e 'DEVELOPING' and ! -e 'Makefile') {
+ plan tests => 7;
+}
+else {
+ plan skip_all =>
+ q{Relevant only when working in checkout from repository and prior to configuration};
+}
use Carp;
use Cwd;
use File::Copy;
Modified: branches/gsoc_past_optimization/t/configure/018-revision_to_cache.t
==============================================================================
--- branches/gsoc_past_optimization/t/configure/018-revision_to_cache.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/configure/018-revision_to_cache.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -7,10 +7,13 @@
use warnings;
use Test::More;
-plan( skip_all =>
- "\nRelevant only when working in checkout from repository and during configuration" )
- unless (-e 'DEVELOPING' and ! -e 'Makefile');
-plan( tests => 8 );
+if (-e 'DEVELOPING' and ! -e 'Makefile') {
+ plan tests => 8;
+}
+else {
+ plan skip_all =>
+ q{Relevant only when working in checkout from repository and prior to configuration};
+}
use Carp;
use Cwd;
use File::Copy;
Modified: branches/gsoc_past_optimization/t/configure/061-revision_from_cache.t
==============================================================================
--- branches/gsoc_past_optimization/t/configure/061-revision_from_cache.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/configure/061-revision_from_cache.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -7,10 +7,17 @@
use warnings;
use Test::More;
-plan( skip_all =>
- "\nRelevant only when working in checkout from repository and during configuration" )
- unless (-e 'DEVELOPING' and ! -e 'Makefile');
-plan( tests => 25 );
+#plan( skip_all =>
+# "\nRelevant only when working in checkout from repository and during configuration" )
+# unless (-e 'DEVELOPING' and ! -e 'Makefile');
+#plan( tests => 25 );
+if (-e 'DEVELOPING' and ! -e 'Makefile') {
+ plan tests => 25;
+}
+else {
+ plan skip_all =>
+ q{Relevant only when working in checkout from repository and prior to configuration};
+}
use Carp;
use Cwd;
use File::Copy;
Modified: branches/gsoc_past_optimization/t/dynpmc/gziphandle.t
==============================================================================
--- branches/gsoc_past_optimization/t/dynpmc/gziphandle.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/dynpmc/gziphandle.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -24,7 +24,7 @@
.local pmc config_hash, interp
.local int num_tests
- num_tests = 9
+ num_tests = 10
plan(num_tests)
interp = getinterp
config_hash = interp[.IGLOBALS_CONFIG_HASH]
@@ -48,8 +48,8 @@
$P0 = new 'GzipHandle'
$S0 = typeof $P0
is($S0, 'GzipHandle', 'GzipHandle typeof')
- $I0 = does $P0, 'Handle'
- ok($I0, 'does Handle')
+ $I0 = isa $P0, 'Handle'
+ ok($I0, 'isa Handle')
.end
.include 'stat.pasm'
@@ -70,6 +70,8 @@
ok($I2, "compressed")
$P2 = new 'GzipHandle'
$P2.'open'(filename, 'rb')
+ $I2 = $P2.'isatty'()
+ is($I2, 0, 'isatty')
$S1 = $P2.'read'($I0)
$P2.'close'()
is($S1, $S0, "gzip stream")
Modified: branches/gsoc_past_optimization/t/pmc/filehandle.t
==============================================================================
--- branches/gsoc_past_optimization/t/pmc/filehandle.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/pmc/filehandle.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 21;
+use Parrot::Test tests => 23;
use Parrot::Test::Util 'create_tempfile';
use Parrot::Test::Util 'create_tempfile';
@@ -40,6 +40,7 @@
# L<PDD22/I\/O PMC API/=item open.*=item close>
pir_output_is( <<"CODE", <<'OUT', 'open and close - synchronous' );
.sub 'test' :main
+ .local int i
\$P1 = new ['FileHandle']
\$P1.'open'('README')
say 'ok 1 - \$P1.open(\$S1)'
@@ -73,6 +74,14 @@
\$P7.'open'('$temp_file', 'w')
say 'ok 7 - \$P7.open(\$S1, \$S2) # new file, write mode succeeds'
+ i = \$P7.'is_closed'()
+ print 'is_closed: '
+ say i
+ \$P7.'close'()
+ i = \$P7.'is_closed'()
+ print 'is_closed after close: '
+ say i
+
goto end
eh_bad_file_1:
@@ -93,6 +102,48 @@
ok 5 - $P5.open($S1) # with bad file
ok 6 - $P6.open($S1, $S2) # with bad file
ok 7 - $P7.open($S1, $S2) # new file, write mode succeeds
+is_closed: 0
+is_closed after close: 1
+OUT
+
+pir_output_is( <<'CODE', <<'OUT', 'wrong open' );
+.include 'except_types.pasm'
+
+.sub main :main
+ .local pmc fh, eh
+ .local int i
+ i = 1
+ eh = new['ExceptionHandler']
+ eh = .EXCEPTION_PIO_ERROR
+ set_addr eh, catchnoname
+ push_eh eh
+ fh = new['FileHandle']
+ # Open without filename
+ fh.'open'()
+ i = 0
+ goto reportnoname
+ catchnoname:
+ finalize eh
+ reportnoname:
+ say i
+
+ i = 0
+ set_addr eh, catchreopen
+ fh.'open'('README')
+ i = 1
+ # Open already opened
+ fh.'open'('README')
+ i = 0
+ goto reportreopen
+ catchreopen:
+ finalize eh
+ reportreopen:
+ say i
+ pop_eh
+.end
+CODE
+1
+1
OUT
pir_output_is( <<'CODE', <<'OUT', 'isatty' );
@@ -584,6 +635,39 @@
ok
OUTPUT
+pir_output_is( <<'CODE', <<'OUTPUT', "readall - failure conditions" );
+.include 'except_types.pasm'
+.sub main :main
+ .local pmc fh, eh
+ fh = new ['FileHandle']
+ eh = new ['ExceptionHandler']
+ eh.'handle_types'(.EXCEPTION_PIO_ERROR)
+ set_addr eh, catch1
+ push_eh eh
+ # Using unopened FileHandle
+ fh.'readall'()
+ say 'should never happen'
+ goto test2
+ catch1:
+ finalize eh
+ say 'caught unopened'
+ test2:
+ set_addr eh, catch2
+ fh.'open'('README')
+ # Using opened FileHandle with the filepath option
+ fh.'readall'('README')
+ say 'should never happen'
+ goto end
+ catch2:
+ finalize eh
+ say 'caught reopen'
+ end:
+.end
+CODE
+caught unopened
+caught reopen
+OUTPUT
+
pir_output_is( <<"CODE", <<"OUTPUT", "readall() - utf8 on closed filehandle" );
.sub 'main'
.local pmc ifh
Modified: branches/gsoc_past_optimization/t/postconfigure/05-trace.t
==============================================================================
--- branches/gsoc_past_optimization/t/postconfigure/05-trace.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/postconfigure/05-trace.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -14,7 +14,8 @@
plan tests => 40;
}
else {
- plan skip_all => q{Tests irrelevant unless configuration completed with tracing requested};
+ plan skip_all =>
+ q{Tests irrelevant unless configuration completed with tracing requested};
}
use lib qw( lib );
use Parrot::Config;
Modified: branches/gsoc_past_optimization/t/tools/pbc_disassemble.t
==============================================================================
--- branches/gsoc_past_optimization/t/tools/pbc_disassemble.t Mon Jul 5 16:35:33 2010 (r48011)
+++ branches/gsoc_past_optimization/t/tools/pbc_disassemble.t Mon Jul 5 17:14:37 2010 (r48012)
@@ -32,7 +32,6 @@
use lib qw(lib);
use Test::More;
-use IO::File ();
use Parrot::Config;
use File::Spec;
use Parrot::Test;
More information about the parrot-commits
mailing list