[svn:parrot] r37164 - in trunk: . config/gen/makefiles lib/Parrot/Ops2c src src/pmc

cotto at svn.parrot.org cotto at svn.parrot.org
Sat Mar 7 12:36:16 UTC 2009


Author: cotto
Date: Sat Mar  7 12:36:15 2009
New Revision: 37164
URL: https://trac.parrot.org/parrot/changeset/37164

Log:
[PMC] revert previous ParrotLibrary commits, which did in fact break something

Modified:
   trunk/MANIFEST.generated
   trunk/config/gen/makefiles/root.in
   trunk/lib/Parrot/Ops2c/Utils.pm
   trunk/src/dynext.c
   trunk/src/interpreter.c
   trunk/src/pmc/parrotlibrary.pmc

Modified: trunk/MANIFEST.generated
==============================================================================
--- trunk/MANIFEST.generated	Sat Mar  7 12:25:35 2009	(r37163)
+++ trunk/MANIFEST.generated	Sat Mar  7 12:36:15 2009	(r37164)
@@ -279,7 +279,6 @@
 src/pmc/pmc_integer.h                             [devel]include
 src/pmc/pmc_multisub.h                            [devel]include
 src/pmc/pmc_object.h                              [devel]include
-src/pmc/pmc_parrotlibrary.h                       [devel]include
 src/pmc/pmc_resizablepmcarray.h                   [devel]include
 src/pmc/pmc_scalar.h                              [devel]include
 src/pmc/pmc_string.h                              [devel]include

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Sat Mar  7 12:25:35 2009	(r37163)
+++ trunk/config/gen/makefiles/root.in	Sat Mar  7 12:36:15 2009	(r37164)
@@ -1094,8 +1094,7 @@
 
 $(SRC_DIR)/longopt$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/dynext$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/dynext.str \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+$(SRC_DIR)/dynext$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/dynext.str
 
 $(SRC_DIR)/exceptions$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/exceptions.str \
 	$(SRC_DIR)/pmc/pmc_continuation.h
@@ -1107,8 +1106,7 @@
 $(SRC_DIR)/extend$(O) : $(GENERAL_H_FILES) $(INC_DIR)/extend.h \
 	$(SRC_DIR)/pmc/pmc_sub.h
 
-$(SRC_DIR)/interpreter$(O) : $(SRC_DIR)/interpreter.c $(GENERAL_H_FILES) \
-	$(SRC_DIR)/pmc/pmc_parrotlibrary.h
+$(SRC_DIR)/interpreter$(O) : $(SRC_DIR)/interpreter.c $(GENERAL_H_FILES)
 
 $(SRC_DIR)/call/pcc$(O) : $(SRC_DIR)/call/pcc.c $(GENERAL_H_FILES) \
 	$(SRC_DIR)/call/pcc.str $(SRC_DIR)/pmc/pmc_fixedintegerarray.h \

Modified: trunk/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- trunk/lib/Parrot/Ops2c/Utils.pm	Sat Mar  7 12:25:35 2009	(r37163)
+++ trunk/lib/Parrot/Ops2c/Utils.pm	Sat Mar  7 12:36:15 2009	(r37164)
@@ -476,7 +476,6 @@
     print $fh <<END_C;
 #include "parrot/parrot.h"
 #include "parrot/oplib.h"
-#include "../pmc/pmc_parrotlibrary.h"
 
 $self->{sym_export} op_lib_t *$self->{init_func}(long init);
 
@@ -1063,7 +1062,7 @@
 $load_func(PARROT_INTERP)
 {
     PMC *const lib      = pmc_new(interp, enum_class_ParrotLibrary);
-    ((Parrot_ParrotLibrary_attributes*)PMC_data(lib))->oplib_init = $self->{init_func};
+    PMC_struct_val(lib) = (void *) $self->{init_func};
     dynop_register(interp, lib);
     return lib;
 }

Modified: trunk/src/dynext.c
==============================================================================
--- trunk/src/dynext.c	Sat Mar  7 12:25:35 2009	(r37163)
+++ trunk/src/dynext.c	Sat Mar  7 12:36:15 2009	(r37164)
@@ -21,7 +21,6 @@
 #include "parrot/parrot.h"
 #include "parrot/dynext.h"
 #include "dynext.str"
-#include "pmc/pmc_parrotlibrary.h"
 
 /* HEADERIZER HFILE: include/parrot/dynext.h */
 
@@ -421,7 +420,7 @@
         /* we could set a private flag in the PMC header too
          * but currently only ops files have struct_val set */
 
-        if (((Parrot_ParrotLibrary_attributes *)PMC_data(lib_pmc))->oplib_init)
+        if (PMC_struct_val(lib_pmc))
             type = CONST_STRING(interp, "Ops");
         else
             type = CONST_STRING(interp, "PMC");

Modified: trunk/src/interpreter.c
==============================================================================
--- trunk/src/interpreter.c	Sat Mar  7 12:25:35 2009	(r37163)
+++ trunk/src/interpreter.c	Sat Mar  7 12:36:15 2009	(r37164)
@@ -47,7 +47,6 @@
 #  include "parrot/oplib/core_ops_cgp.h"
 #endif
 #include "parrot/dynext.h"
-#include "pmc/pmc_parrotlibrary.h"
 
 
 /* HEADERIZER HFILE: none */
@@ -471,8 +470,7 @@
 get_dynamic_op_lib_init(SHIM_INTERP, ARGIN(const PMC *lib))
 {
     ASSERT_ARGS(get_dynamic_op_lib_init)
-    return (oplib_init_f)D2FPTR(
-            ((Parrot_ParrotLibrary_attributes *)PMC_data(lib))->oplib_init);
+    return (oplib_init_f)D2FPTR(PMC_struct_val(lib));
 }
 
 

Modified: trunk/src/pmc/parrotlibrary.pmc
==============================================================================
--- trunk/src/pmc/parrotlibrary.pmc	Sat Mar  7 12:25:35 2009	(r37163)
+++ trunk/src/pmc/parrotlibrary.pmc	Sat Mar  7 12:36:15 2009	(r37164)
@@ -10,6 +10,10 @@
 
 Class for holding info about a dynamic library.
 
+     PMC data
+     PMC_struct_val(SELF)   oplib init function
+     PMC_data(SELF)         DLL handle
+
 Properties:
 
     _filename               full path/file of lib
@@ -31,11 +35,9 @@
 #include "parrot/parrot.h"
 
 #define PMC_dlhandle(x) ((Parrot_ParrotLibrary_attributes*)PMC_data(x))->dl_handle
-#define PMC_oplib_init(x) ((Parrot_ParrotLibrary_attributes*)PMC_data(x))->oplib_init
 
 pmclass ParrotLibrary need_ext provides library {
-    ATTR void * dl_handle;  /* DLL handle */
-    ATTR void * oplib_init; /* oplib init function */
+    ATTR void * dl_handle;
 
 /*
 
@@ -52,6 +54,7 @@
             mem_allocate_zeroed_typed(Parrot_ParrotLibrary_attributes);
         PMC_data(SELF) = attrs;
         PObj_active_destroy_SET(SELF);
+        PMC_struct_val(SELF) = NULL;
     }
 
 /*
@@ -84,7 +87,7 @@
 
     VTABLE PMC *clone() {
         PMC *dest            = pmc_new(INTERP, SELF->vtable->base_type);
-        PMC_oplib_init(dest) = PMC_oplib_init(SELF);
+        PMC_struct_val(dest) = PMC_struct_val(SELF);
         PMC_dlhandle(dest)   = PMC_dlhandle(SELF);
 
         if (PMC_metadata(SELF))


More information about the parrot-commits mailing list