[svn:parrot] r40651 - in trunk: config/gen include/parrot src
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Wed Aug 19 08:56:00 UTC 2009
Author: NotFound
Date: Wed Aug 19 08:55:58 2009
New Revision: 40651
URL: https://trac.parrot.org/parrot/changeset/40651
Log:
[core] some decoupling between core initialization steps
Modified:
trunk/config/gen/core_pmcs.pm
trunk/include/parrot/global_setup.h
trunk/src/global_setup.c
Modified: trunk/config/gen/core_pmcs.pm
==============================================================================
--- trunk/config/gen/core_pmcs.pm Wed Aug 19 07:45:38 2009 (r40650)
+++ trunk/config/gen/core_pmcs.pm Wed Aug 19 08:55:58 2009 (r40651)
@@ -116,26 +116,20 @@
__attribute__nonnull__(1)
__attribute__nonnull__(2);
-extern void Parrot_initialize_core_pmcs(PARROT_INTERP)
+extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass)
__attribute__nonnull__(1);
-void Parrot_initialize_core_pmcs(PARROT_INTERP)
+void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass)
{
- int pass;
- for (pass = 0; pass <= 1; ++pass) {
- /* first the PMC with the highest enum
- * this reduces MMD table resize action */
+ /* first the PMC with the highest enum
+ * this reduces MMD table resize action */
END_C
- print {$OUT} " Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
+ print {$OUT} " Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
foreach ( @pmcs[ -1 .. -1 ] );
- print {$OUT} " Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
+ print {$OUT} " Parrot_${_}_class_init(interp, enum_class_${_}, pass);\n"
foreach ( @pmcs[ 0 .. $#pmcs - 1 ] );
print {$OUT} <<'END_C';
- if (!pass) {
- parrot_global_setup_2(interp);
- }
- }
}
static void register_pmc(PARROT_INTERP, NOTNULL(PMC *registry), int pmc_id)
Modified: trunk/include/parrot/global_setup.h
==============================================================================
--- trunk/include/parrot/global_setup.h Wed Aug 19 07:45:38 2009 (r40650)
+++ trunk/include/parrot/global_setup.h Wed Aug 19 08:55:58 2009 (r40651)
@@ -32,9 +32,6 @@
void init_world_once(PARROT_INTERP)
__attribute__nonnull__(1);
-void parrot_global_setup_2(PARROT_INTERP)
- __attribute__nonnull__(1);
-
#define ASSERT_ARGS_Parrot_set_config_hash_internal \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(parrot_config)
@@ -42,8 +39,6 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_init_world_once __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_parrot_global_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: src/global_setup.c */
Modified: trunk/src/global_setup.c
==============================================================================
--- trunk/src/global_setup.c Wed Aug 19 07:45:38 2009 (r40650)
+++ trunk/src/global_setup.c Wed Aug 19 08:55:58 2009 (r40651)
@@ -27,7 +27,7 @@
/* These functions are defined in the auto-generated file core_pmcs.c */
/* XXX Get it into some public place */
-extern void Parrot_initialize_core_pmcs(PARROT_INTERP);
+extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass);
void Parrot_register_core_pmcs(PARROT_INTERP, PMC* registry);
static const unsigned char* parrot_config_stored = NULL;
@@ -38,9 +38,14 @@
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
+static void parrot_global_setup_2(PARROT_INTERP)
+ __attribute__nonnull__(1);
+
static void parrot_set_config_hash_interpreter(PARROT_INTERP)
__attribute__nonnull__(1);
+#define ASSERT_ARGS_parrot_global_setup_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_parrot_set_config_hash_interpreter \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
@@ -162,7 +167,9 @@
parrot_alloc_vtables(interp);
/* Call base vtable class constructor methods */
- Parrot_initialize_core_pmcs(interp);
+ Parrot_initialize_core_pmcs(interp, 0);
+ parrot_global_setup_2(interp);
+ Parrot_initialize_core_pmcs(interp, 1);
iglobals = interp->iglobals;
VTABLE_set_pmc_keyed_int(interp, iglobals,
@@ -190,7 +197,7 @@
/*
-=item C<void parrot_global_setup_2(PARROT_INTERP)>
+=item C<static void parrot_global_setup_2(PARROT_INTERP)>
called from inmidst of PMC bootstrapping between pass 0 and 1
@@ -198,7 +205,7 @@
*/
-void
+static void
parrot_global_setup_2(PARROT_INTERP)
{
ASSERT_ARGS(parrot_global_setup_2)
More information about the parrot-commits
mailing list