[svn:parrot] r41159 - in trunk: config/gen/makefiles src/runcore

chromatic at svn.parrot.org chromatic at svn.parrot.org
Tue Sep 8 18:05:28 UTC 2009


Author: chromatic
Date: Tue Sep  8 18:05:25 2009
New Revision: 41159
URL: https://trac.parrot.org/parrot/changeset/41159

Log:
[runcore] Moved default runcore selection to Parrot_runcore_init() and made the
fast runcore the default runcore for non-debug builds.

Modified:
   trunk/config/gen/makefiles/root.in
   trunk/src/runcore/cores.c
   trunk/src/runcore/main.c

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Tue Sep  8 18:03:48 2009	(r41158)
+++ trunk/config/gen/makefiles/root.in	Tue Sep  8 18:05:25 2009	(r41159)
@@ -637,6 +637,7 @@
     $(SRC_DIR)/pmc_freeze.str \
     $(SRC_DIR)/oo.str \
     $(SRC_DIR)/runcore/cores.str \
+    $(SRC_DIR)/runcore/main.str \
     $(SRC_DIR)/runcore/profiling.str \
     $(SRC_DIR)/scheduler.str \
     $(SRC_DIR)/spf_render.str \
@@ -1146,7 +1147,8 @@
 $(SRC_DIR)/extend$(O) : $(GENERAL_H_FILES) $(INC_DIR)/extend.h \
 	$(SRC_DIR)/pmc/pmc_sub.h
 
-$(SRC_DIR)/runcore/main$(O) : $(SRC_DIR)/runcore/main.c $(GENERAL_H_FILES) \
+$(SRC_DIR)/runcore/main$(O) : $(SRC_DIR)/runcore/main.c \
+	$(SRC_DIR)/runcore/main.str $(GENERAL_H_FILES) \
 	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
 
 $(SRC_DIR)/runcore/profiling$(O) : $(SRC_DIR)/runcore/profiling.str $(GENERAL_H_FILES) \

Modified: trunk/src/runcore/cores.c
==============================================================================
--- trunk/src/runcore/cores.c	Tue Sep  8 18:03:48 2009	(r41158)
+++ trunk/src/runcore/cores.c	Tue Sep  8 18:05:25 2009	(r41159)
@@ -430,9 +430,6 @@
     PARROT_RUNCORE_FUNC_TABLE_SET(coredata);
 
     Parrot_runcore_register(interp, coredata);
-
-    /* it's the first runcore and the default runcore */
-    Parrot_runcore_switch(interp, coredata->name);
 }
 
 

Modified: trunk/src/runcore/main.c
==============================================================================
--- trunk/src/runcore/main.c	Tue Sep  8 18:03:48 2009	(r41158)
+++ trunk/src/runcore/main.c	Tue Sep  8 18:05:25 2009	(r41159)
@@ -38,6 +38,8 @@
 #include "parrot/oplib/core_ops.h"
 #include "parrot/oplib/core_ops_switch.h"
 #include "parrot/oplib/ops.h"
+#include "main.str"
+
 #if JIT_CAPABLE
 #  include "parrot/exec.h"
 #  include "../jit.h"
@@ -126,9 +128,14 @@
 Parrot_runcore_init(PARROT_INTERP)
 {
     ASSERT_ARGS(Parrot_runcore_init)
+#ifdef NDEBUG
+    STRING * const default_core = CONST_STRING(interp, "slow");
+#else
+    STRING * const default_core = CONST_STRING(interp, "fast");
+#endif
 
-    interp->cores     = NULL;
-    interp->num_cores = 0;
+    interp->cores        = NULL;
+    interp->num_cores    = 0;
 
     Parrot_runcore_slow_init(interp);
     Parrot_runcore_fast_init(interp);
@@ -142,6 +149,9 @@
 
     Parrot_runcore_profiling_init(interp);
 
+    /* set the default runcore */
+    Parrot_runcore_switch(interp, default_core);
+
 #ifdef HAVE_COMPUTED_GOTO
     Parrot_runcore_cgp_init(interp);
     Parrot_runcore_cgoto_init(interp);


More information about the parrot-commits mailing list