perl.cvs.mod_parrot
[Top] [All Lists]

[svn:mod_parrot] r387 - in mod_parrot/branches/configure: . include lib/

Subject: [svn:mod_parrot] r387 - in mod_parrot/branches/configure: . include lib/ModParrot/HLL src
From: particle@xxxxxxxxxxxx
Date: Fri, 25 Jul 2008 11:27:54 -0700 (PDT)
Newsgroups: perl.cvs.mod_parrot

Author: particle
Date: Fri Jul 25 11:27:53 2008
New Revision: 387

Modified:
   mod_parrot/branches/configure/Configure.pl
   mod_parrot/branches/configure/include/mod_parrot.h
   mod_parrot/branches/configure/lib/ModParrot/HLL/pipp.pir
   mod_parrot/branches/configure/src/context.c
   mod_parrot/branches/configure/src/mod_parrot.c
   mod_parrot/branches/configure/src/modparrot_config.c

Log:
[SVN MERGE] -r 372:HEAD http://svn.perl.org/parrot-modules/mod_parrot/trunk

Modified: mod_parrot/branches/configure/Configure.pl
==============================================================================
--- mod_parrot/branches/configure/Configure.pl  (original)
+++ mod_parrot/branches/configure/Configure.pl  Fri Jul 25 11:27:53 2008
@@ -255,12 +255,6 @@
 __END__
 
 
-## step process_opts -- THE REST IS LEFTOVERS
-
-# defines to pass to compiler
-my $defines;
-
-
 ## step gen::apache_test_config
 print "Creating testing infrastructure...";
 eval "use Apache::Test 1.26";

Modified: mod_parrot/branches/configure/include/mod_parrot.h
==============================================================================
--- mod_parrot/branches/configure/include/mod_parrot.h  (original)
+++ mod_parrot/branches/configure/include/mod_parrot.h  Fri Jul 25 11:27:53 2008
@@ -79,7 +79,7 @@
 void release_ctx(modparrot_context *);
 modparrot_context *get_interp_ctx(Parrot_Interp);
 void set_interp_ctx(Parrot_Interp, modparrot_context *);
-modparrot_context *modparrot_startup(apr_pool_t *, server_rec *);
+modparrot_context *modparrot_startup(apr_pool_t *, server_rec *, 
Parrot_Interp);
 void modparrot_load_file(Parrot_Interp, server_rec *, char *, char *);
 module *modparrot_add_module(Parrot_Interp, apr_pool_t *, const char *,
     Parrot_PMC);

Modified: mod_parrot/branches/configure/lib/ModParrot/HLL/pipp.pir
==============================================================================
--- mod_parrot/branches/configure/lib/ModParrot/HLL/pipp.pir    (original)
+++ mod_parrot/branches/configure/lib/ModParrot/HLL/pipp.pir    Fri Jul 25 
11:27:53 2008
@@ -59,7 +59,7 @@
     
     php_file = r.'filename'()
     interp.'capture_stdout'(1)
-    status = run_php_file(php_file)
+    run_php_file(php_file)
     r.'content_type'("text/html")
 
     $S0 = interp.'dump_stdout'()

Modified: mod_parrot/branches/configure/src/context.c
==============================================================================
--- mod_parrot/branches/configure/src/context.c (original)
+++ mod_parrot/branches/configure/src/context.c Fri Jul 25 11:27:53 2008
@@ -62,7 +62,7 @@
 
     /* pop each context off the list and destroy its interpreter */
     while ((ctxpp = apr_array_pop(ctx_pool))) {
-        if ((*ctxpp)->interp && !(*ctxpp)->parent_interp) {
+        if ((*ctxpp)->interp) {
             modparrot_destroy_interpreter((*ctxpp)->interp);
             (*ctxpp)->interp = NULL;
         }

Modified: mod_parrot/branches/configure/src/mod_parrot.c
==============================================================================
--- mod_parrot/branches/configure/src/mod_parrot.c      (original)
+++ mod_parrot/branches/configure/src/mod_parrot.c      Fri Jul 25 11:27:53 2008
@@ -158,15 +158,16 @@
 }
 
 /* public interface for starting an interpreter */
-modparrot_context *modparrot_startup(apr_pool_t *p, server_rec *s)
+modparrot_context *modparrot_startup(apr_pool_t *p, server_rec *s,
+    Parrot_Interp parent_interp)
 {
     modparrot_context *ctxp;
     modparrot_srv_config *cfg;
 
     cfg = ap_get_module_config(s->module_config, &parrot_module);
 
-    if (!mp_is_started) {
-        if (!(cfg->ctx_pool = mp_ctx_pool_init(p, NULL, 1))) {
+    if (!mp_is_started || (!cfg->ctx_pool && s->is_virtual)) {
+        if (!(cfg->ctx_pool = mp_ctx_pool_init(p, parent_interp, 1))) {
             MPLOG_ERROR(s, "context pool creation failed");
             return NULL;
         }
@@ -949,7 +950,7 @@
     cfg = ap_get_module_config(s->module_config, &parrot_module);
 
     if (cfg->option_flags & MP_OPT_ENABLE) {
-        if (!(ctxp = modparrot_startup(pconf, s))) {
+        if (!(ctxp = modparrot_startup(pconf, s, NULL))) {
             return HTTP_INTERNAL_SERVER_ERROR;
         }
         parent_interp = ctxp->interp;
@@ -970,23 +971,20 @@
         vscfg = ap_get_module_config(vs->module_config, &parrot_module);
         if (!(vscfg->option_flags & MP_OPT_ENABLE)) continue;
         if (vscfg->option_flags & MP_OPT_PARENT) {
-            /* XXX this crashes if we don't specify parent context. we can't
-             * create multiple interpreters in the same process, which is a
-             * either a problem with parrot or a problem with my understanding
-             * of the interpreter creation process.
-             */
-            if (!(vscfg->ctx_pool =
-                mp_ctx_pool_init(pconf, parent_interp, 1))) {
-                MPLOG_ERROR(s, "context pool creation failed");
+            if (!(vsctxp = modparrot_startup(pconf, vs, parent_interp))) {
                 return HTTP_INTERNAL_SERVER_ERROR;
             }
-            if (!(vsctxp = init_ctx(vs))) {
-                MPLOG_ERROR(vs, "context initialization failed");
-                return HTTP_INTERNAL_SERVER_ERROR;
+
+            /* load ParrotLoad files */
+            modparrot_load_files(vsctxp->interp, vs, vscfg->preload);
+
+            /* if we weren't tracing the initialization phase, enable tracing 
*/
+            if (!(vscfg->option_flags & MP_OPT_TRACE_INIT)) {
+                Parrot_set_trace(vsctxp->interp, vscfg->trace_flags);
             }
         }
         else {
-            if (cfg->option_flags & MP_OPT_ENABLE) {
+            if (vscfg->option_flags & MP_OPT_ENABLE) {
                 vscfg->ctx_pool = cfg->ctx_pool;
             }
             else {

Modified: mod_parrot/branches/configure/src/modparrot_config.c
==============================================================================
--- mod_parrot/branches/configure/src/modparrot_config.c        (original)
+++ mod_parrot/branches/configure/src/modparrot_config.c        Fri Jul 25 
11:27:53 2008
@@ -300,7 +300,7 @@
 
     /* XXX how do we get the context if we've already started? */
     if (!mp_is_started) {
-        ctxp = modparrot_startup(cmd->pool, cmd->server);
+        ctxp = modparrot_startup(cmd->pool, cmd->server, NULL);
     }
 
     parse_handler(cmd->pool, handler, l);
@@ -600,7 +600,7 @@
     modparrot_module_cmd_data *data = cmd->cmd->cmd_data;
     int ret;
 
-    ctxp = modparrot_startup(cmd->pool, cmd->server);
+    ctxp = modparrot_startup(cmd->pool, cmd->server, NULL);
     set_mp_config_vectors(ctxp, cmd);
     args = make_cmd_args_array(ctxp->interp, cmd->pool, 1, arg);
     ret = Parrot_call_sub_ret_int(ctxp->interp, data->func, "IP", args);
@@ -616,7 +616,7 @@
     modparrot_module_cmd_data *data = cmd->cmd->cmd_data;
     int ret;
 
-    ctxp = modparrot_startup(cmd->pool, cmd->server);
+    ctxp = modparrot_startup(cmd->pool, cmd->server, NULL);
     args = make_cmd_args_array(ctxp->interp, cmd->pool, 2, arg1, arg2);
     ret = Parrot_call_sub_ret_int(ctxp->interp, data->func, "IP", args);
     return NULL;
@@ -631,7 +631,7 @@
     modparrot_module_cmd_data *data = cmd->cmd->cmd_data;
     int ret;
 
-    ctxp = modparrot_startup(cmd->pool, cmd->server);
+    ctxp = modparrot_startup(cmd->pool, cmd->server, NULL);
     args = make_cmd_args_array(ctxp->interp, cmd->pool, 2, arg1, arg2);
     ret = Parrot_call_sub_ret_int(ctxp->interp, data->func, "IP", args);
     return NULL;
@@ -647,7 +647,7 @@
     modparrot_module_cmd_data *data = cmd->cmd->cmd_data;
     int ret;
 
-    ctxp = modparrot_startup(cmd->pool, cmd->server);
+    ctxp = modparrot_startup(cmd->pool, cmd->server, NULL);
     args = make_cmd_args_array(ctxp->interp, cmd->pool, 3, arg1, arg2, arg3);
     ret = Parrot_call_sub_ret_int(ctxp->interp, data->func, "IP", args);
     return NULL;
@@ -663,7 +663,7 @@
     modparrot_module_cmd_data *data = cmd->cmd->cmd_data;
     int ret;
 
-    ctxp = modparrot_startup(cmd->pool, cmd->server);
+    ctxp = modparrot_startup(cmd->pool, cmd->server, NULL);
     args = make_cmd_args_array(ctxp->interp, cmd->pool, 3, arg1, arg2, arg3);
     ret = Parrot_call_sub_ret_int(ctxp->interp, data->func, "IP", args);
     return NULL;
@@ -679,7 +679,7 @@
     modparrot_module_cmd_data *data = cmd->cmd->cmd_data;
     int ret;
 
-    ctxp = modparrot_startup(cmd->pool, cmd->server);
+    ctxp = modparrot_startup(cmd->pool, cmd->server, NULL);
     args = make_cmd_args_array(ctxp->interp, cmd->pool, 3, arg1, arg2, arg3);
     ret = Parrot_call_sub_ret_int(ctxp->interp, data->func, "IP", args);
     return NULL;

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:mod_parrot] r387 - in mod_parrot/branches/configure: . include lib/ModParrot/HLL src, particle <=