Skip to content

Commit

Permalink
Some fix. do_sub_pragmas is back public for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristaba authored and cotto committed Jan 1, 2011
1 parent 74168f9 commit 39626b8
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
16 changes: 8 additions & 8 deletions config/gen/makefiles/root.in
Expand Up @@ -491,7 +491,7 @@ INTERP_O_FILES = \
src/oo$(O) \
src/platform$(O) \
src/packfile/object_serialization$(O) \
src/packfile/execute$(O) \
src/packfile/execute$(O) \
src/pmc$(O) \
src/runcore/main$(O) \
src/runcore/cores$(O) \
Expand Down Expand Up @@ -696,7 +696,7 @@ STR_FILES = \
#IF(has_extra_nci_thunks): src/nci/extra_thunks.str \
src/nci/signatures.str \
src/packfile/api.str \
src/packfile/execute.str \
src/packfile/execute.str \
src/packfile/object_serialization.str \
src/packfile/pf_items.str \
src/pmc.str \
Expand Down Expand Up @@ -1599,7 +1599,7 @@ src/multidispatch$(O) : \
src/packfile/api$(O) : \
src/packfile/api.str \
src/packfile/api.c \
src/packfile/packfile_private.h \
src/packfile/packfile_private.h \
include/pmc/pmc_sub.h \
include/pmc/pmc_key.h \
include/pmc/pmc_parrotlibrary.h \
Expand All @@ -1620,11 +1620,11 @@ src/packfile/api$(O) : \
$(INC_DIR)/runcore_api.h

src/packfile/execute$(O) : \
$(PARROT_H_HEADERS) \
src/packfile/execute.str \
src/packfile/execute.c \
src/packfile/packfile_private.h \
include/pmc/pmc_sub.h
$(PARROT_H_HEADERS) \
src/packfile/execute.str \
src/packfile/execute.c \
src/packfile/packfile_private.h \
include/pmc/pmc_sub.h


src/packfile/output$(O) : $(PARROT_H_HEADERS) include/pmc/pmc_key.h src/packfile/output.c
Expand Down
20 changes: 20 additions & 0 deletions include/parrot/packfile.h
Expand Up @@ -1111,6 +1111,26 @@ opcode_t PackFile_pack_size(PARROT_INTERP, ARGMOD(PackFile *self))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/packfile/output.c */


/* This is temporary, to make do_sub_pragmas public... */
/* HEADERIZER BEGIN: src/packfile/execute.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

void do_sub_pragmas(PARROT_INTERP,
ARGIN(PackFile_ByteCode *self),
pbc_action_enum_t action,
ARGIN_NULLOK(PMC *eval_pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

#define ASSERT_ARGS_do_sub_pragmas __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(self))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/packfile/execute.c */



#endif /* PARROT_PACKFILE_H_GUARD */

/*
Expand Down
8 changes: 2 additions & 6 deletions src/embed.c
Expand Up @@ -563,12 +563,8 @@ Parrot_pbc_read(PARROT_INTERP, ARGIN_NULLOK(const char *fullname), const int deb
}

/* Set :main routine */
if (!(pf->options & PFOPT_HEADERONLY)) {
if (pf->cur_cs != NULL)
Parrot_pbc_load(interp, pf);
PackFile_fixup_subs(interp, PBC_PBC, NULL);
}

if (!(pf->options & PFOPT_HEADERONLY))
do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
/* Prederefing the sub/the bytecode is done in switch_to_cs before
* actual usage of the segment */

Expand Down
9 changes: 2 additions & 7 deletions src/embed/api.c
Expand Up @@ -329,10 +329,7 @@ Parrot_api_load_bytecode_file(Parrot_PMC interp_pmc,
PackFile * const pf = Parrot_pbc_read(interp, filename, 0);
if (!pf)
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not load packfile");
if (pf->cur_cs != NULL)
Parrot_pbc_load(interp, pf);
PackFile_fixup_subs(interp, PBC_PBC, NULL);
*pbc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL); *pbc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, *pbc, pf);
EMBED_API_CALLOUT(interp_pmc, interp)
}
Expand Down Expand Up @@ -364,9 +361,7 @@ Parrot_api_load_bytecode_bytes(Parrot_PMC interp_pmc,

if (!PackFile_unpack(interp, pf, (const opcode_t *)pbc, bytecode_size))
Parrot_ex_throw_from_c_args(interp, NULL, 1, "could not unpack packfile");
if (pf->cur_cs != NULL)
Parrot_pbc_load(interp, pf);
PackFile_fixup_subs(interp, PBC_PBC, NULL);
do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
*pbcpmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, *pbcpmc, pf);
EMBED_API_CALLOUT(interp_pmc, interp);
Expand Down
4 changes: 2 additions & 2 deletions src/packfile/execute.c
Expand Up @@ -22,8 +22,8 @@ This file contain some private functions relating to executing functions.
#include "execute.str"



/* HEADERIZER HFILE: src/packfile/packfile_private.h */
/* This is temporary, to make do_sub_pragmas public... */
/* HEADERIZER HFILE: include/parrot/packfile.h */

/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Expand Down
19 changes: 5 additions & 14 deletions src/packfile/packfile_private.h
Expand Up @@ -14,25 +14,16 @@ that are only for use in the packfile and don't need to be included in the rest
Parrot.
*/


#ifndef PARROT_PACKFILE_PRIVATE_H_GUARD
#define PARROT_PACKFILE_PRIVATE_H_GUARD

/* HEADERIZER BEGIN: src/packfile/execute.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

void do_sub_pragmas(PARROT_INTERP,
ARGIN(PackFile_ByteCode *self),
pbc_action_enum_t action,
ARGIN_NULLOK(PMC *eval_pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

#define ASSERT_ARGS_do_sub_pragmas __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(self))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

/* HEADERIZER END: src/packfile/execute.c */


#endif // PARROT_PACKFILE_PRIVATE_H_GUARD

/*
* Local variables:
* c-file-style: "parrot"
Expand Down
4 changes: 1 addition & 3 deletions src/pmc/eval.pmc
Expand Up @@ -325,9 +325,7 @@ Unarchives the code.
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
"couldn't unpack packfile");

if (pf->cur_cs != NULL)
Parrot_pbc_load(interp, pf);
PackFile_fixup_subs(INTERP, PBC_PBC, SELF);
do_sub_pragmas(INTERP, pf->cur_cs, PBC_PBC, SELF);

for (i = 0; i < pf->directory.num_segments; ++i) {
seg = pf->directory.segments[i];
Expand Down

0 comments on commit 39626b8

Please sign in to comment.