diff --git a/MANIFEST b/MANIFEST index eec496a5d5..bb111e865a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -240,7 +240,6 @@ config/gen/platform/cygwin/math.c [] config/gen/platform/darwin/begin.c [] config/gen/platform/darwin/hires_timer.c [] config/gen/platform/darwin/sysmem.c [] -config/gen/platform/freebsd/sysmem.c [] config/gen/platform/generic/dl.c [] config/gen/platform/generic/dl.h [] config/gen/platform/generic/env.c [] @@ -264,7 +263,6 @@ config/gen/platform/ia64/asm.s [] config/gen/platform/netbsd/math.c [] config/gen/platform/netbsd/misc.c [] config/gen/platform/netbsd/misc.h [] -config/gen/platform/netbsd/sysmem.c [] config/gen/platform/openbsd/math.c [] config/gen/platform/openbsd/memexec.c [] config/gen/platform/openbsd/misc.h [] diff --git a/README b/README index ae41e5472c..e177932c4f 100644 --- a/README +++ b/README @@ -39,21 +39,21 @@ The method depends on your distribution. To install you should execute (as root On Ubuntu/Debian (apt-based): - apt-get install git-core + apt-get install git-core On Red Hat, Fedora (rpm-based): - yum install git + yum install git on Gentoo (portage): - emerge -av dev-vcs/git + emerge -av dev-vcs/git Windows: There are 2 Git ports on Windows: -msysgit (http://code.google.com/p/msysgit/downloads/list) -TortoiseGit (http://code.google.com/p/tortoisegit/downloads/list) +msysgit http://code.google.com/p/msysgit/downloads/list +TortoiseGit http://code.google.com/p/tortoisegit/downloads/list Macintosh OS X An Internet search will locate a variety of git installers for Mac OS X, @@ -63,17 +63,21 @@ including this: II. Obtaining Parrot from github.com -In Git, branches represent some major changes of source. -You can view the list of branches at http://github.com/parrot/parrot -To fetch the source from the master branch: +To get a copy of the Parrot Git repository: + + git clone git://github.com/parrot/parrot.git - git clone git://github.com/parrot/parrot.git +This will checkout the master branch by default. To create a local branch +that tracks the branch "some_branch": -To fetch the source from a branch: + git checkout -b --track some_branch origin/some_branch - git clone git://github.com/parrot/parrot.git -b , e.g: +All the above URLs are read-only. If you are a Parrot core developer, then +use the read-write URL: - git clone git://github.com/parrot/parrot.git -b gsoc_threads + git clone git@github.com:parrot/parrot.git + +You can view the list of branches at http://github.com/parrot/parrot INSTRUCTIONS ------------ diff --git a/config/auto/headers.pm b/config/auto/headers.pm index f52b3be3ca..8f2338dbe0 100644 --- a/config/auto/headers.pm +++ b/config/auto/headers.pm @@ -97,7 +97,7 @@ sub _list_extra_headers { # the header. my @extra_headers = qw(malloc.h fcntl.h setjmp.h pthread.h signal.h sys/types.h sys/socket.h netinet/in.h arpa/inet.h - sys/stat.h sysexit.h limits.h); + sys/stat.h sysexit.h limits.h sys/sysctl.h); # more extra_headers needed on mingw/msys; *BSD fails if they are present if ( $conf->data->get('OSNAME_provisional') eq "msys" ) { diff --git a/config/gen/platform/freebsd/sysmem.c b/config/gen/platform/freebsd/sysmem.c deleted file mode 100644 index 4d21d74cdc..0000000000 --- a/config/gen/platform/freebsd/sysmem.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2010, Parrot Foundation. - */ - -/* - -=head1 NAME - -config/gen/platform/freebsd/sysmem.c - -=head1 DESCRIPTION - -Get system memory information. - -=head2 Functions - -=over 4 - -=cut - -*/ -#include -#include - -/* - -=item C - -Get information about available physical memory. - -=cut - -*/ - -size_t -Parrot_sysmem_amount(PARROT_INTERP) -{ - int err = 0; - size_t memsize = 0; - char *err_msg; - unsigned long length = sizeof (memsize); - - int selection[2] = { CTL_HW, HW_PHYSMEM }; - - err = sysctl(selection, 2, &memsize, &length, NULL, 0); - - if (err) { - err_msg = strerror(err); - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR, - "sysctl failed: %s", err_msg); - } - - return memsize; -} - -/* - -=back - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/config/gen/platform/generic/sysmem.c b/config/gen/platform/generic/sysmem.c index d2f2c82aac..95695b138a 100644 --- a/config/gen/platform/generic/sysmem.c +++ b/config/gen/platform/generic/sysmem.c @@ -20,11 +20,12 @@ Get system memory information. */ +#include #include #include "parrot/sysmem.h" -#ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ -# define _SC_PAGE_SIZE _SC_PAGESIZE +#if defined(PARROT_HAS_HEADER_SYSSYSCTL) +# include #endif /* @@ -37,10 +38,59 @@ Get information about available physical memory. */ +/* + * The POSIX name is _SC_PAGESIZE, but apparently some systems + * require _SC_PAGE_SIZE instead. (Specific citations would + * be useful.) + */ +#if !defined(_SC_PAGESIZE) && defined(_SC_PAGE_SIZE) +# define _SC_PAGESIZE _SC_PAGE_SIZE +#endif + size_t Parrot_sysmem_amount(PARROT_INTERP) { - return sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGE_SIZE); + size_t memsize = 0; + +#if defined(_SC_PAGESIZE) && defined(_SC_AVPHYS_PAGES) + /* Method 1: sysconf(). + * Works on Linux and Solaris, and probably other SVR4-related systems. + * This should really check for #ifdef HAS_SYSCONF, but Configure + * doesn't probe for that yet. + */ + memsize = sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGESIZE); + +#elif defined(PARROT_HAS_HEADER_SYSSYSCTL) && defined(CTL_HW) && defined(HW_PHYSMEM) + + /* Method 2: sysctl(). Works on BSD-derived systems. Darwin is + * slightly different, and has its own implementation. + * Configure really should test for HAS_SYSCTL, but, for now, test for + * the header sys/sysctl.h and the appropriate constants. + */ + + int err = 0; + char *err_msg; + unsigned long length = sizeof (memsize); + + int selection[2] = { CTL_HW, HW_PHYSMEM }; + + err = sysctl(selection, 2, &memsize, &length, NULL, 0); + + if (err) { + err_msg = strerror(err); + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR, + "sysctl failed: %s", err_msg); + } + +#else + /* Method 3: Random guess. Simply guess 512 MB. This way, parrot + * will at least build. Arguably, one could also just put an error + * here and instruct the user to fix it manually. + */ + memsize = 512 * 1024 * 1024; +#endif + + return memsize; } /* diff --git a/config/gen/platform/netbsd/sysmem.c b/config/gen/platform/netbsd/sysmem.c deleted file mode 100644 index 37594d764e..0000000000 --- a/config/gen/platform/netbsd/sysmem.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2010, Parrot Foundation. - */ - -/* - -=head1 NAME - -config/gen/platform/netbsd/sysmem.c - -=head1 DESCRIPTION - -Get system memory information. - -=head2 Functions - -=over 4 - -=cut - -*/ -#include -#include - -/* - -=item C - -Get information about available physical memory. - -=cut - -*/ - -size_t -Parrot_sysmem_amount(PARROT_INTERP) -{ - int err = 0; - size_t memsize = 0; - char *err_msg; - unsigned long length = sizeof (memsize); - - int selection[2] = { CTL_HW, HW_PHYSMEM }; - - err = sysctl(selection, 2, &memsize, &length, NULL, 0); - - if (err) { - err_msg = strerror(err); - Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR, - "sysctl failed: %s", err_msg); - } - - return memsize; -} - -/* - -=back - -=cut - -*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4 cinoptions='\:2=2' : - */ diff --git a/docs/embed.pod b/docs/embed.pod index 3ab319fd0f..dac8dad423 100644 --- a/docs/embed.pod +++ b/docs/embed.pod @@ -658,7 +658,7 @@ The list may also be augmented if additional functionality is required. =item C -=item C +=item C =item C diff --git a/docs/project/git_workflow.pod b/docs/project/git_workflow.pod index 3e1e26ba13..d30ef58bcc 100644 --- a/docs/project/git_workflow.pod +++ b/docs/project/git_workflow.pod @@ -112,6 +112,15 @@ that will be included in your next commit) : The command C is not only for adding new files, just keep that in mind. It tells git "add the state of these files to my staging area." +If you are trying to add files that are in .gitignore, you can do that with +the --force flag: + + git add --force ports/foo + +NOTE: Make sure these files should actually be added. Most files in .gitignore should +never be added, but some, such as some files in "ports/" will need need the --force +flag. + Now for actually creating your commit! Since Git is a distributed version control system, committing code is seperate from sending your changes to a remote server. Keep this in mind if you are used to Subversion or similar VCS's, where committing diff --git a/include/parrot/hll.h b/include/parrot/hll.h index 050f460381..bb4fb3ccb6 100644 --- a/include/parrot/hll.h +++ b/include/parrot/hll.h @@ -52,7 +52,9 @@ PMC* Parrot_hll_get_HLL_namespace(PARROT_INTERP, int hll_id) __attribute__nonnull__(1); PARROT_EXPORT -INTVAL Parrot_hll_get_HLL_type(PARROT_INTERP, INTVAL hll_id, INTVAL core_type) +INTVAL Parrot_hll_get_HLL_type(PARROT_INTERP, + INTVAL hll_id, + INTVAL core_type) __attribute__nonnull__(1); PARROT_EXPORT @@ -74,7 +76,8 @@ void Parrot_hll_register_HLL_type(PARROT_INTERP, void Parrot_hll_init_HLL(PARROT_INTERP) __attribute__nonnull__(1); -#define ASSERT_ARGS_Parrot_hll_get_ctx_HLL_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_hll_get_ctx_HLL_namespace \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_hll_get_ctx_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) diff --git a/include/parrot/oplib/core_ops.h b/include/parrot/oplib/core_ops.h index f122ef2e1e..b526c4944c 100644 --- a/include/parrot/oplib/core_ops.h +++ b/include/parrot/oplib/core_ops.h @@ -51,7 +51,7 @@ op_lib_t *Parrot_DynOp_core_2_10_1(PARROT_INTERP, long init); opcode_t * Parrot_yield(opcode_t *, PARROT_INTERP); opcode_t * Parrot_tailcall_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_returncc(opcode_t *, PARROT_INTERP); - opcode_t * Parrot_capture_lex_p(opcode_t *, PARROT_INTERP); + opcode_t * Parrot_sub_capture_lex_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_newclosure_p_p(opcode_t *, PARROT_INTERP); opcode_t * Parrot_set_args_pc(opcode_t *, PARROT_INTERP); opcode_t * Parrot_get_params_pc(opcode_t *, PARROT_INTERP); diff --git a/include/parrot/sub.h b/include/parrot/sub.h index ff34126f34..2e2db511e4 100644 --- a/include/parrot/sub.h +++ b/include/parrot/sub.h @@ -162,13 +162,19 @@ typedef struct Parrot_Context_info { /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ PARROT_EXPORT -void Parrot_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc)) +PARROT_CANNOT_RETURN_NULL +void * Parrot_get_sub_pmc_from_subclass(PARROT_INTERP, ARGIN(PMC *subclass)) + __attribute__nonnull__(1) + __attribute__nonnull__(2); + +PARROT_EXPORT +void Parrot_sub_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2) FUNC_MODIFIES(*sub_pmc); PARROT_EXPORT -int Parrot_Context_get_info(PARROT_INTERP, +int Parrot_sub_context_get_info(PARROT_INTERP, ARGIN(PMC *ctx), ARGOUT(Parrot_Context_info *info)) __attribute__nonnull__(1) @@ -179,41 +185,35 @@ int Parrot_Context_get_info(PARROT_INTERP, PARROT_EXPORT PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT -STRING* Parrot_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) +STRING* Parrot_sub_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_EXPORT PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT -STRING* Parrot_full_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC* sub_pmc)) +STRING* Parrot_sub_full_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC* sub_pmc)) __attribute__nonnull__(1); -PARROT_EXPORT -PARROT_CANNOT_RETURN_NULL -void * Parrot_get_sub_pmc_from_subclass(PARROT_INTERP, ARGIN(PMC *subclass)) - __attribute__nonnull__(1) - __attribute__nonnull__(2); - PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT -PMC* parrot_new_closure(PARROT_INTERP, ARGIN(PMC *sub_pmc)) +PMC* Parrot_sub_new_closure(PARROT_INTERP, ARGIN(PMC *sub_pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2); -void mark_context_start(void); -void Parrot_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc)) +void Parrot_sub_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2); -void Parrot_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc)) +void Parrot_sub_continuation_rewind_environment(PARROT_INTERP, + ARGIN(PMC *pmc)) __attribute__nonnull__(1) __attribute__nonnull__(2); PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT -PMC* Parrot_find_dynamic_pad(PARROT_INTERP, +PMC* Parrot_sub_find_dynamic_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) __attribute__nonnull__(1) @@ -222,7 +222,7 @@ PMC* Parrot_find_dynamic_pad(PARROT_INTERP, PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT -PMC* Parrot_find_pad(PARROT_INTERP, +PMC* Parrot_sub_find_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) __attribute__nonnull__(1) @@ -230,56 +230,57 @@ PMC* Parrot_find_pad(PARROT_INTERP, __attribute__nonnull__(3); PARROT_CANNOT_RETURN_NULL -STRING * Parrot_Sub_get_filename_from_pc(PARROT_INTERP, +STRING * Parrot_sub_get_filename_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULLOK(opcode_t *pc)) __attribute__nonnull__(1); -INTVAL Parrot_Sub_get_line_from_pc(PARROT_INTERP, +INTVAL Parrot_sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULLOK(opcode_t *pc)) __attribute__nonnull__(1); -#define ASSERT_ARGS_Parrot_capture_lex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +void Parrot_sub_mark_context_start(void); +#define ASSERT_ARGS_Parrot_get_sub_pmc_from_subclass \ + __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp) \ + , PARROT_ASSERT_ARG(subclass)) +#define ASSERT_ARGS_Parrot_sub_capture_lex __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(sub_pmc)) -#define ASSERT_ARGS_Parrot_Context_get_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_context_get_info __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(ctx) \ , PARROT_ASSERT_ARG(info)) -#define ASSERT_ARGS_Parrot_Context_infostr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_Context_infostr __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(ctx)) -#define ASSERT_ARGS_Parrot_full_sub_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_full_sub_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_get_sub_pmc_from_subclass \ - __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp) \ - , PARROT_ASSERT_ARG(subclass)) -#define ASSERT_ARGS_parrot_new_closure __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_new_closure __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(sub_pmc)) -#define ASSERT_ARGS_mark_context_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) -#define ASSERT_ARGS_Parrot_continuation_check __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_continuation_check __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pmc)) -#define ASSERT_ARGS_Parrot_continuation_rewind_environment \ +#define ASSERT_ARGS_Parrot_sub_continuation_rewind_environment \ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(pmc)) -#define ASSERT_ARGS_Parrot_find_dynamic_pad __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_find_dynamic_pad __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(lex_name) \ , PARROT_ASSERT_ARG(ctx)) -#define ASSERT_ARGS_Parrot_find_pad __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_find_pad __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ , PARROT_ASSERT_ARG(lex_name) \ , PARROT_ASSERT_ARG(ctx)) -#define ASSERT_ARGS_Parrot_Sub_get_filename_from_pc \ +#define ASSERT_ARGS_Parrot_sub_get_filename_from_pc \ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) -#define ASSERT_ARGS_Parrot_Sub_get_line_from_pc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ +#define ASSERT_ARGS_Parrot_sub_get_line_from_pc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_sub_mark_context_start __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: src/sub.c */ diff --git a/lib/Parrot/Vtable.pm b/lib/Parrot/Vtable.pm index 60738bd02f..4aee771e63 100644 --- a/lib/Parrot/Vtable.pm +++ b/lib/Parrot/Vtable.pm @@ -241,8 +241,6 @@ EOM # finally the name mapping $macros .= <<'EOM'; -#ifdef PARROT_IN_OBJECTS_C - #define PARROT_VTABLE_LOW 9 static PARROT_OBSERVER const char * const Parrot_vtable_slot_names[] = { @@ -272,7 +270,6 @@ EOM #define NUM_VTABLE_FUNCTIONS $num_vtable_funcs -#endif /* PARROT_IN_OBJECTS_C */ EOM $macros; diff --git a/src/debug.c b/src/debug.c index d2cdec7831..f643942f50 100644 --- a/src/debug.c +++ b/src/debug.c @@ -3267,7 +3267,7 @@ PDB_backtrace(PARROT_INTERP) PMC *ctx = CURRENT_CONTEXT(interp); if (!PMC_IS_NULL(sub)) { - str = Parrot_Context_infostr(interp, ctx); + str = Parrot_sub_Context_infostr(interp, ctx); if (str) { Parrot_io_eprintf(interp, "%Ss", str); if (interp->code->annotations) { @@ -3309,7 +3309,7 @@ PDB_backtrace(PARROT_INTERP) break; - str = Parrot_Context_infostr(interp, Parrot_pcc_get_caller_ctx(interp, ctx)); + str = Parrot_sub_Context_infostr(interp, Parrot_pcc_get_caller_ctx(interp, ctx)); if (!str) diff --git a/src/dynoplibs/debug.ops b/src/dynoplibs/debug.ops index 2491cfadf4..92899c9dc7 100644 --- a/src/dynoplibs/debug.ops +++ b/src/dynoplibs/debug.ops @@ -117,7 +117,7 @@ Get the current line number. inline op getline(out INT) { Parrot_Context_info info; - Parrot_Context_get_info(interp, CURRENT_CONTEXT(interp), &info); + Parrot_sub_context_get_info(interp, CURRENT_CONTEXT(interp), &info); $1 = info.line; } @@ -129,7 +129,7 @@ Get the name of the current file. inline op getfile(out STR) { Parrot_Context_info info; - Parrot_Context_get_info(interp, CURRENT_CONTEXT(interp), &info); + Parrot_sub_context_get_info(interp, CURRENT_CONTEXT(interp), &info); $1 = info.file; } diff --git a/src/gc/mark_sweep.c b/src/gc/mark_sweep.c index 8b7e8b2ea7..e4f15703cd 100644 --- a/src/gc/mark_sweep.c +++ b/src/gc/mark_sweep.c @@ -161,7 +161,7 @@ Parrot_gc_trace_root(PARROT_INTERP, PObj *obj; /* note: adding locals here did cause increased GC runs */ - mark_context_start(); + Parrot_sub_mark_context_start(); if (trace == GC_TRACE_SYSTEM_ONLY) { trace_system_areas(interp, mem_pools); diff --git a/src/global_setup.c b/src/global_setup.c index 73cf397fce..c6db73b374 100644 --- a/src/global_setup.c +++ b/src/global_setup.c @@ -38,17 +38,17 @@ static unsigned int parrot_config_size_stored = 0; /* HEADERIZER BEGIN: static */ /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ -static void Parrot_gbl_setup_2(PARROT_INTERP) +static void Parrot_gbl_set_config_hash_interpreter(PARROT_INTERP) __attribute__nonnull__(1); -static void Parrot_gbl_set_config_hash_interpreter(PARROT_INTERP) +static void Parrot_gbl_setup_2(PARROT_INTERP) __attribute__nonnull__(1); -#define ASSERT_ARGS_Parrot_gbl_setup_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(interp)) #define ASSERT_ARGS_Parrot_gbl_set_config_hash_interpreter \ __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp)) +#define ASSERT_ARGS_Parrot_gbl_setup_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ + PARROT_ASSERT_ARG(interp)) /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ /* HEADERIZER END: static */ diff --git a/src/namespace.c b/src/namespace.c index 2bd2b0b956..e92e8ccb3d 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -688,7 +688,7 @@ Parrot_ns_find_named_item(PARROT_INTERP, ARGIN(STRING *name), SHIM(void *next)) { ASSERT_ARGS(Parrot_ns_find_named_item) PMC * const ctx = CURRENT_CONTEXT(interp); - PMC * const lex_pad = Parrot_find_pad(interp, name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, name, ctx); PMC * g = PMCNULL; if (!PMC_IS_NULL(lex_pad)) { diff --git a/src/oo.c b/src/oo.c index 2de2ea8959..7068642a27 100644 --- a/src/oo.c +++ b/src/oo.c @@ -17,8 +17,6 @@ Handles class and object manipulation. */ -#define PARROT_IN_OO_C -#define PARROT_IN_OBJECTS_C /* To get the vtable.h imports we want. */ #include "parrot/parrot.h" #include "parrot/oo_private.h" #include "pmc/pmc_class.h" diff --git a/src/ops/core.ops b/src/ops/core.ops index a82b305912..da3d3c1e05 100644 --- a/src/ops/core.ops +++ b/src/ops/core.ops @@ -440,11 +440,11 @@ inline op returncc() :flow { } inline op capture_lex(invar PMC) { - Parrot_capture_lex(interp, $1); + Parrot_sub_capture_lex(interp, $1); } inline op newclosure(out PMC, invar PMC) { - $1 = parrot_new_closure(interp, $2); + $1 = Parrot_sub_new_closure(interp, $2); } =back diff --git a/src/ops/core_ops.c b/src/ops/core_ops.c index 4ac641374f..a1d36a692a 100644 --- a/src/ops/core_ops.c +++ b/src/ops/core_ops.c @@ -105,7 +105,7 @@ static op_func_t core_op_func_table[1074] = { Parrot_yield, /* 27 */ Parrot_tailcall_p, /* 28 */ Parrot_returncc, /* 29 */ - Parrot_capture_lex_p, /* 30 */ + Parrot_sub_capture_lex_p, /* 30 */ Parrot_newclosure_p_p, /* 31 */ Parrot_set_args_pc, /* 32 */ Parrot_get_params_pc, /* 33 */ @@ -1553,7 +1553,7 @@ static op_info_t core_op_info_table[1074] = { /* type PARROT_INLINE_OP, */ "capture_lex", "capture_lex_p", - "Parrot_capture_lex_p", + "Parrot_sub_capture_lex_p", /* "", body */ 0, 2, @@ -15388,16 +15388,16 @@ Parrot_returncc(opcode_t *cur_opcode, PARROT_INTERP) { } opcode_t * -Parrot_capture_lex_p(opcode_t *cur_opcode, PARROT_INTERP) { +Parrot_sub_capture_lex_p(opcode_t *cur_opcode, PARROT_INTERP) { const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx); - Parrot_capture_lex(interp, PREG(1)); + Parrot_sub_capture_lex(interp, PREG(1)); return (opcode_t *)cur_opcode + 2;} opcode_t * Parrot_newclosure_p_p(opcode_t *cur_opcode, PARROT_INTERP) { const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx); - PREG(1) = parrot_new_closure(interp, PREG(2)); + PREG(1) = Parrot_sub_new_closure(interp, PREG(2)); return (opcode_t *)cur_opcode + 3;} @@ -23514,7 +23514,7 @@ Parrot_store_lex_s_p(opcode_t *cur_opcode, PARROT_INTERP) { const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx); PMC * const ctx = CURRENT_CONTEXT(interp); STRING * const lex_name = SREG(1); - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); if (PMC_IS_NULL(lex_pad)) { opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL, @@ -23530,7 +23530,7 @@ Parrot_store_lex_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx); PMC * const ctx = CURRENT_CONTEXT(interp); STRING * const lex_name = SCONST(1); - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); if (PMC_IS_NULL(lex_pad)) { opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL, @@ -23550,7 +23550,7 @@ Parrot_store_dynamic_lex_s_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const lex_pad = PMC_IS_NULL(ctx) ? PMCNULL - : Parrot_find_dynamic_pad(interp, lex_name, ctx); + : Parrot_sub_find_dynamic_pad(interp, lex_name, ctx); if (PMC_IS_NULL(lex_pad)) { opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL, @@ -23570,7 +23570,7 @@ Parrot_store_dynamic_lex_sc_p(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const lex_pad = PMC_IS_NULL(ctx) ? PMCNULL - : Parrot_find_dynamic_pad(interp, lex_name, ctx); + : Parrot_sub_find_dynamic_pad(interp, lex_name, ctx); if (PMC_IS_NULL(lex_pad)) { opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL, @@ -23586,7 +23586,7 @@ Parrot_find_lex_p_s(opcode_t *cur_opcode, PARROT_INTERP) { const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx); PMC * const ctx = CURRENT_CONTEXT(interp); STRING * const lex_name = SREG(2); - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); PMC * const result = PMC_IS_NULL(lex_pad) @@ -23601,7 +23601,7 @@ Parrot_find_lex_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { const Parrot_Context * const CUR_CTX = Parrot_pcc_get_context_struct(interp, interp->ctx); PMC * const ctx = CURRENT_CONTEXT(interp); STRING * const lex_name = SCONST(2); - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); PMC * const result = PMC_IS_NULL(lex_pad) @@ -23620,7 +23620,7 @@ Parrot_find_dynamic_lex_p_s(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const lex_pad = PMC_IS_NULL(ctx) ? PMCNULL - : Parrot_find_dynamic_pad(interp, lex_name, ctx); + : Parrot_sub_find_dynamic_pad(interp, lex_name, ctx); PMC * const result = PMC_IS_NULL(lex_pad) ? PMCNULL @@ -23638,7 +23638,7 @@ Parrot_find_dynamic_lex_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { PMC * const lex_pad = PMC_IS_NULL(ctx) ? PMCNULL - : Parrot_find_dynamic_pad(interp, lex_name, ctx); + : Parrot_sub_find_dynamic_pad(interp, lex_name, ctx); PMC * const result = PMC_IS_NULL(lex_pad) ? PMCNULL @@ -23658,7 +23658,7 @@ Parrot_find_caller_lex_p_s(opcode_t *cur_opcode, PARROT_INTERP) { !PMC_IS_NULL(ctx) && PMC_IS_NULL(result); ctx = Parrot_pcc_get_caller_ctx(interp, ctx)) { - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); if (!PMC_IS_NULL(lex_pad)) { result = VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name); } @@ -23679,7 +23679,7 @@ Parrot_find_caller_lex_p_sc(opcode_t *cur_opcode, PARROT_INTERP) { !PMC_IS_NULL(ctx) && PMC_IS_NULL(result); ctx = Parrot_pcc_get_caller_ctx(interp, ctx)) { - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); if (!PMC_IS_NULL(lex_pad)) { result = VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name); } diff --git a/src/ops/var.ops b/src/ops/var.ops index a05773060a..682fa3c385 100644 --- a/src/ops/var.ops +++ b/src/ops/var.ops @@ -41,7 +41,7 @@ Parrot's LexPad throws an exception for unknown names. op store_lex(in STR, invar PMC) { PMC * const ctx = CURRENT_CONTEXT(interp); STRING * const lex_name = $1; - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); if (PMC_IS_NULL(lex_pad)) { opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL, @@ -70,7 +70,7 @@ op store_dynamic_lex(in STR, invar PMC) { PMC * const lex_pad = PMC_IS_NULL(ctx) ? PMCNULL - : Parrot_find_dynamic_pad(interp, lex_name, ctx); + : Parrot_sub_find_dynamic_pad(interp, lex_name, ctx); if (PMC_IS_NULL(lex_pad)) { opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL, @@ -93,7 +93,7 @@ Null PMC if the variable is not found. op find_lex(out PMC, in STR) { PMC * const ctx = CURRENT_CONTEXT(interp); STRING * const lex_name = $2; - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); PMC * const result = PMC_IS_NULL(lex_pad) @@ -120,7 +120,7 @@ op find_dynamic_lex(out PMC, in STR) { PMC * const lex_pad = PMC_IS_NULL(ctx) ? PMCNULL - : Parrot_find_dynamic_pad(interp, lex_name, ctx); + : Parrot_sub_find_dynamic_pad(interp, lex_name, ctx); PMC * const result = PMC_IS_NULL(lex_pad) ? PMCNULL @@ -146,7 +146,7 @@ op find_caller_lex(out PMC, in STR) { !PMC_IS_NULL(ctx) && PMC_IS_NULL(result); ctx = Parrot_pcc_get_caller_ctx(interp, ctx)) { - PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx); + PMC * const lex_pad = Parrot_sub_find_pad(interp, lex_name, ctx); if (!PMC_IS_NULL(lex_pad)) { result = VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name); } diff --git a/src/pmc/class.pmc b/src/pmc/class.pmc index 7f017cd060..51ea0550ce 100644 --- a/src/pmc/class.pmc +++ b/src/pmc/class.pmc @@ -88,7 +88,6 @@ An empty ResizablePMCArray PMC is allocated during initialization. */ -#define PARROT_IN_OBJECTS_C /* To get the vtable.h imports we want. */ #include "parrot/oo_private.h" #include "pmc/pmc_object.h" #include "pmc/pmc_namespace.h" diff --git a/src/pmc/continuation.pmc b/src/pmc/continuation.pmc index b946f42176..23171e0933 100644 --- a/src/pmc/continuation.pmc +++ b/src/pmc/continuation.pmc @@ -259,8 +259,8 @@ destination to continue execution. GET_ATTR_to_ctx(INTERP, SELF, to_ctx); GET_ATTR_to_call_object(INTERP, SELF, call_obj); - Parrot_continuation_check(INTERP, SELF); - Parrot_continuation_rewind_environment(INTERP, SELF); + Parrot_sub_continuation_check(INTERP, SELF); + Parrot_sub_continuation_rewind_environment(INTERP, SELF); if (!PMC_IS_NULL(from_obj)) Parrot_pcc_set_signature(INTERP, CURRENT_CONTEXT(INTERP), from_obj); @@ -287,7 +287,7 @@ Experimental: returns caller info as a STRING. PMC *to_ctx; GET_ATTR_to_ctx(INTERP, SELF, to_ctx); - return Parrot_Context_infostr(INTERP, to_ctx); + return Parrot_sub_Context_infostr(INTERP, to_ctx); } diff --git a/src/pmc/coroutine.pmc b/src/pmc/coroutine.pmc index b91ce3406d..9eab059541 100644 --- a/src/pmc/coroutine.pmc +++ b/src/pmc/coroutine.pmc @@ -67,11 +67,11 @@ print_sub_name(PARROT_INTERP, ARGIN(PMC *sub_pmc)) Parrot_io_eprintf(tracer, "# %s coroutine '%Ss'", !(PObj_get_FLAGS(sub_pmc) & SUB_FLAG_CORO_FF) ? "Calling" : "yielding from", - Parrot_full_sub_name(interp, sub_pmc)); + Parrot_sub_full_sub_name(interp, sub_pmc)); if (!PMC_IS_NULL(ctx) && (PObj_get_FLAGS(sub_pmc) & SUB_FLAG_CORO_FF)) { Parrot_io_eprintf(tracer, " to '%Ss'", - Parrot_full_sub_name(interp, + Parrot_sub_full_sub_name(interp, Parrot_pcc_get_sub(interp, Parrot_pcc_get_caller_ctx(interp, ctx)))); } diff --git a/src/pmc/exceptionhandler.pmc b/src/pmc/exceptionhandler.pmc index c6d7f69354..81b2bc2619 100644 --- a/src/pmc/exceptionhandler.pmc +++ b/src/pmc/exceptionhandler.pmc @@ -142,8 +142,8 @@ Set up the environment for the exception handler to be invoked. VTABLE opcode_t *invoke(void *next) { opcode_t * const pc = PARROT_CONTINUATION(SELF)->address; - Parrot_continuation_check(INTERP, SELF); - Parrot_continuation_rewind_environment(INTERP, SELF); + Parrot_sub_continuation_check(INTERP, SELF); + Parrot_sub_continuation_rewind_environment(INTERP, SELF); /* switch code segment if needed */ if (INTERP->code != PARROT_CONTINUATION(SELF)->seg) diff --git a/src/pmc/fixedbooleanarray.pmc b/src/pmc/fixedbooleanarray.pmc index 5bb71563b6..713d3ecd8a 100644 --- a/src/pmc/fixedbooleanarray.pmc +++ b/src/pmc/fixedbooleanarray.pmc @@ -31,6 +31,7 @@ Auxiliar function to avoid repeating the size evaluation. /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ PARROT_INLINE +PARROT_CONST_FUNCTION static UINTVAL get_size_in_bytes(UINTVAL size); #define ASSERT_ARGS_get_size_in_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (0) @@ -38,6 +39,7 @@ static UINTVAL get_size_in_bytes(UINTVAL size); /* HEADERIZER END: static */ PARROT_INLINE +PARROT_CONST_FUNCTION static UINTVAL get_size_in_bytes(UINTVAL size) { @@ -125,7 +127,7 @@ Creates and returns a copy of the array. */ VTABLE PMC *clone() { - unsigned char * my_bit_array, * clone_bit_array; + unsigned char * my_bit_array; UINTVAL resize_threshold, size; PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); @@ -134,6 +136,7 @@ Creates and returns a copy of the array. GET_ATTR_resize_threshold(INTERP, SELF, resize_threshold); if (my_bit_array) { + unsigned char * clone_bit_array; const size_t size_in_bytes = get_size_in_bytes(resize_threshold); SET_ATTR_size(INTERP, dest, size); @@ -272,13 +275,12 @@ Returns the Parrot string representation of the array. */ VTABLE STRING *get_string() { - STRING *zero, *one; STRING *str = STRINGNULL; UINTVAL i; - UINTVAL elems = SELF.elements(); + const UINTVAL elems = SELF.elements(); - zero = CONST_STRING(INTERP, "0"); - one = CONST_STRING(INTERP, "1"); + STRING * const zero = CONST_STRING(INTERP, "0"); + STRING * const one = CONST_STRING(INTERP, "1"); for (i = 0; i < elems; ++i) { if (SELF.get_integer_keyed_int((INTVAL)i)) diff --git a/src/pmc/sub.pmc b/src/pmc/sub.pmc index 758d3c9789..232303569f 100644 --- a/src/pmc/sub.pmc +++ b/src/pmc/sub.pmc @@ -51,7 +51,7 @@ print_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC *sub)) /* sub was located via globals */ Parrot_io_eprintf(tracer, "# Calling sub '%Ss'\n# ", - Parrot_full_sub_name(interp, sub)); + Parrot_sub_full_sub_name(interp, sub)); print_pbc_location(interp); } diff --git a/src/runcore/profiling.c b/src/runcore/profiling.c index dbee9a17cf..6eb979ae2d 100644 --- a/src/runcore/profiling.c +++ b/src/runcore/profiling.c @@ -527,10 +527,10 @@ ARGIN(PMC *ctx_pmc)) INTVAL line_num = hash_value_to_int(interp, runcore->line_cache, parrot_hash_get(interp, runcore->line_cache, ctx->current_pc)); - /* Parrot_Sub_get_line_from_pc eats up about 20-30% of execution time + /* Parrot_sub_get_line_from_pc eats up about 20-30% of execution time * *with* this cache in place. */ if (line_num == 0) { - line_num = Parrot_Sub_get_line_from_pc(interp, + line_num = Parrot_sub_get_line_from_pc(interp, Parrot_pcc_get_sub(interp, ctx_pmc), ctx->current_pc); parrot_hash_put(interp, runcore->line_cache, ctx->current_pc, (void *) line_num); } @@ -762,7 +762,7 @@ ARGIN(PMC* ctx_pmc), ARGIN(opcode_t *pc)) ASSERT_ARGS(get_filename_cstr) - STRING *filename = Parrot_Sub_get_filename_from_pc(interp, + STRING *filename = Parrot_sub_get_filename_from_pc(interp, Parrot_pcc_get_sub(interp, ctx_pmc), pc); char *filename_cstr = Parrot_str_to_cstring(interp, filename); diff --git a/src/sub.c b/src/sub.c index 97d5e1b8aa..b53b7e6e7b 100644 --- a/src/sub.c +++ b/src/sub.c @@ -29,7 +29,7 @@ Subroutines, continuations, co-routines and other fun stuff... /* -=item C +=item C Indicate that a new round of context marking is about to take place. @@ -40,16 +40,16 @@ Indicate that a new round of context marking is about to take place. static int context_gc_mark = 0; void -mark_context_start(void) +Parrot_sub_mark_context_start(void) { - ASSERT_ARGS(mark_context_start) + ASSERT_ARGS(Parrot_sub_mark_context_start) if (++context_gc_mark == 0) context_gc_mark = 1; } /* -=item C +=item C Return namespace, name, and location of subroutine. @@ -61,9 +61,9 @@ PARROT_EXPORT PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT STRING* -Parrot_full_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC* sub_pmc)) +Parrot_sub_full_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC* sub_pmc)) { - ASSERT_ARGS(Parrot_full_sub_name) + ASSERT_ARGS(Parrot_sub_full_sub_name) if (sub_pmc && VTABLE_defined(interp, sub_pmc)) { Parrot_Sub_attributes *sub; @@ -105,12 +105,12 @@ Parrot_full_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC* sub_pmc)) /* -=item C +=item C Takes pointers to a context and its information table. Populates the table and returns 0 or 1. XXX needs explanation -Used by Parrot_Context_infostr. +Used by Parrot_sub_Context_infostr. =cut @@ -118,10 +118,10 @@ Used by Parrot_Context_infostr. PARROT_EXPORT int -Parrot_Context_get_info(PARROT_INTERP, ARGIN(PMC *ctx), +Parrot_sub_context_get_info(PARROT_INTERP, ARGIN(PMC *ctx), ARGOUT(Parrot_Context_info *info)) { - ASSERT_ARGS(Parrot_Context_get_info) + ASSERT_ARGS(Parrot_sub_context_get_info) PMC *subpmc; Parrot_Sub_attributes *sub; opcode_t *pc; @@ -160,7 +160,7 @@ Parrot_Context_get_info(PARROT_INTERP, ARGIN(PMC *ctx), } else { info->nsname = VTABLE_get_string(interp, sub->namespace_name); - info->fullname = Parrot_full_sub_name(interp, subpmc); + info->fullname = Parrot_sub_full_sub_name(interp, subpmc); } pc = Parrot_pcc_get_pc(interp, ctx); @@ -205,7 +205,7 @@ Parrot_Context_get_info(PARROT_INTERP, ARGIN(PMC *ctx), /* -=item C Given a PMC sub and the current opcode, returns the corresponding PIR line @@ -216,9 +216,9 @@ number. */ INTVAL -Parrot_Sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULLOK(opcode_t *pc)) +Parrot_sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULLOK(opcode_t *pc)) { - ASSERT_ARGS(Parrot_Sub_get_line_from_pc) + ASSERT_ARGS(Parrot_sub_get_line_from_pc) Parrot_Sub_attributes *sub; opcode_t *base_pc, *debug_ops; size_t i, op, current_annotation, debug_size; @@ -257,7 +257,7 @@ Parrot_Sub_get_line_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULL /* -=item C Given a PMC sub and the current opcode, returns the corresponding PIR file @@ -269,10 +269,10 @@ name. PARROT_CANNOT_RETURN_NULL STRING * -Parrot_Sub_get_filename_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), +Parrot_sub_get_filename_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), ARGIN_NULLOK(opcode_t *pc)) { - ASSERT_ARGS(Parrot_Sub_get_filename_from_pc) + ASSERT_ARGS(Parrot_sub_get_filename_from_pc) Parrot_Sub_attributes *sub; PackFile_Debug *debug; int position; @@ -290,7 +290,7 @@ Parrot_Sub_get_filename_from_pc(PARROT_INTERP, ARGIN_NULLOK(PMC *subpmc), /* -=item C +=item C Formats context information for display. Takes a context pointer and returns a pointer to the text. Used in debug.c and warnings.c @@ -303,9 +303,9 @@ PARROT_EXPORT PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT STRING* -Parrot_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) +Parrot_sub_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) { - ASSERT_ARGS(Parrot_Context_infostr) + ASSERT_ARGS(Parrot_sub_Context_infostr) Parrot_Context_info info; STRING *res = NULL; const char * const msg = (CURRENT_CONTEXT(interp) == ctx) @@ -313,7 +313,7 @@ Parrot_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) : "called from Sub"; Parrot_block_GC_mark(interp); - if (Parrot_Context_get_info(interp, ctx, &info)) { + if (Parrot_sub_context_get_info(interp, ctx, &info)) { res = Parrot_sprintf_c(interp, "%s '%Ss' pc %d (%Ss:%d)", msg, @@ -326,7 +326,7 @@ Parrot_Context_infostr(PARROT_INTERP, ARGIN(PMC *ctx)) /* -=item C +=item C Locate the LexPad containing the given name. Return NULL on failure. @@ -337,9 +337,9 @@ Locate the LexPad containing the given name. Return NULL on failure. PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT PMC* -Parrot_find_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) +Parrot_sub_find_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) { - ASSERT_ARGS(Parrot_find_pad) + ASSERT_ARGS(Parrot_sub_find_pad) while (1) { PMC * const lex_pad = Parrot_pcc_get_lex_pad(interp, ctx); PMC * outer = Parrot_pcc_get_outer_ctx(interp, ctx); @@ -358,7 +358,8 @@ Parrot_find_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) /* -=item C +=item C Locate the LexPad containing the given C in C and its caller pads. Return PMCNULL on failure. @@ -370,9 +371,9 @@ its caller pads. Return PMCNULL on failure. PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT PMC* -Parrot_find_dynamic_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) +Parrot_sub_find_dynamic_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) { - ASSERT_ARGS(Parrot_find_dynamic_pad) + ASSERT_ARGS(Parrot_sub_find_dynamic_pad) while (1) { PMC * const lex_pad = Parrot_pcc_get_lex_pad(interp, ctx); PMC * caller = Parrot_pcc_get_caller_ctx(interp, ctx); @@ -391,7 +392,7 @@ Parrot_find_dynamic_pad(PARROT_INTERP, ARGIN(STRING *lex_name), ARGIN(PMC *ctx)) /* -=item C +=item C Capture the current lexical environment of a sub. @@ -401,9 +402,9 @@ Capture the current lexical environment of a sub. PARROT_EXPORT void -Parrot_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc)) +Parrot_sub_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc)) { - ASSERT_ARGS(Parrot_capture_lex) + ASSERT_ARGS(Parrot_sub_capture_lex) PMC * const ctx = CURRENT_CONTEXT(interp); Parrot_Sub_attributes *current_sub; Parrot_Sub_attributes *sub; @@ -445,7 +446,7 @@ Parrot_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc)) /* -=item C +=item C Used where? XXX @@ -462,18 +463,18 @@ PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT PMC* -parrot_new_closure(PARROT_INTERP, ARGIN(PMC *sub_pmc)) +Parrot_sub_new_closure(PARROT_INTERP, ARGIN(PMC *sub_pmc)) { - ASSERT_ARGS(parrot_new_closure) + ASSERT_ARGS(Parrot_sub_new_closure) PMC * const clos_pmc = VTABLE_clone(interp, sub_pmc); - Parrot_capture_lex(interp, clos_pmc); + Parrot_sub_capture_lex(interp, clos_pmc); return clos_pmc; } /* -=item C +=item C Verifies that the provided continuation is sane. @@ -482,9 +483,9 @@ Verifies that the provided continuation is sane. */ void -Parrot_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc)) +Parrot_sub_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc)) { - ASSERT_ARGS(Parrot_continuation_check) + ASSERT_ARGS(Parrot_sub_continuation_check) PMC * const to_ctx = PARROT_CONTINUATION(pmc)->to_ctx; if (PMC_IS_NULL(to_ctx)) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, @@ -493,7 +494,8 @@ Parrot_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc)) /* -=item C +=item C Restores the appropriate context for the continuation. @@ -502,9 +504,9 @@ Restores the appropriate context for the continuation. */ void -Parrot_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc)) +Parrot_sub_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc)) { - ASSERT_ARGS(Parrot_continuation_rewind_environment) + ASSERT_ARGS(Parrot_sub_continuation_rewind_environment) PMC * const to_ctx = PARROT_CONTINUATION(pmc)->to_ctx; PMC * const sig = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); @@ -514,7 +516,7 @@ Parrot_continuation_rewind_environment(PARROT_INTERP, ARGIN(PMC *pmc)) PMC * const sub = Parrot_pcc_get_sub(interp, to_ctx); Parrot_io_eprintf(interp, "# Back in sub '%Ss', env %p\n", - Parrot_full_sub_name(interp, sub), + Parrot_sub_full_sub_name(interp, sub), interp->dynamic_env); } diff --git a/src/thread.c b/src/thread.c index b1797e2623..4096591972 100644 --- a/src/thread.c +++ b/src/thread.c @@ -695,7 +695,7 @@ pt_transfer_sub(ARGOUT(Parrot_Interp d), ARGIN(Parrot_Interp s), ARGIN(PMC *sub) ASSERT_ARGS(pt_transfer_sub) #if defined THREAD_DEBUG && THREAD_DEBUG Parrot_io_eprintf(s, "copying over subroutine [%Ss]\n", - Parrot_full_sub_name(s, sub)); + Parrot_sub_full_sub_name(s, sub)); #endif return make_local_copy(d, s, sub); } diff --git a/src/warnings.c b/src/warnings.c index 5c94c47011..6b6720c885 100644 --- a/src/warnings.c +++ b/src/warnings.c @@ -52,7 +52,7 @@ print_pbc_location(PARROT_INTERP) interp->pdb->debugger : interp; Parrot_io_eprintf(tracer, "%Ss\n", - Parrot_Context_infostr(interp, CURRENT_CONTEXT(interp))); + Parrot_sub_Context_infostr(interp, CURRENT_CONTEXT(interp))); } /*