Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Syncing unintentionally skewed 6model header, as per jnthn++
  • Loading branch information
Geoffrey Broadwell committed Oct 25, 2012
1 parent 75ee64b commit 3619d77
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/binder/sixmodelobject.h
Expand Up @@ -350,6 +350,24 @@ struct SixModel_REPROps {
#define IS_CONCRETE(o) (!PObj_flag_TEST(private0, (o)))
#define MARK_AS_TYPE_OBJECT(o) PObj_flag_SET(private0, (o))

/* Write barriers for noticing changes to objects or STables with an SC. */
typedef void (* obj_sc_barrier_func) (PARROT_INTERP, PMC *obj);
typedef void (* st_sc_barrier_func) (PARROT_INTERP, STable *st);
#define OBJ_SC_WRITE_BARRIER(o) \
if (SC_PMC(o)) { \
((obj_sc_barrier_func) \
D2FPTR(VTABLE_get_pointer(interp, \
VTABLE_get_pmc_keyed_str(interp, interp->root_namespace, \
Parrot_str_new_constant(interp, "_OBJ_SC_BARRIER")))))(interp, o); \
}
#define ST_SC_WRITE_BARRIER(st) \
if ((st)->sc) { \
((st_sc_barrier_func) \
D2FPTR(VTABLE_get_pointer(interp, \
VTABLE_get_pmc_keyed_str(interp, interp->root_namespace, \
Parrot_str_new_constant(interp, "_ST_SC_BARRIER")))))(interp, st); \
}

/* Object model initialization. */
void SixModelObject_initialize(PARROT_INTERP, PMC **knowhow, PMC **knowhow_attribute);

Expand All @@ -360,7 +378,9 @@ PMC * create_stable(PARROT_INTERP, REPROps *REPR, PMC *HOW);
PMC * decontainerize(PARROT_INTERP, PMC *var);

/* Dynamic representation registration. */
typedef INTVAL (* rf) (PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, void *, void *));
typedef PMC * (*wrap_object_t)(PARROT_INTERP, void *obj);
typedef PMC * (*create_stable_t)(PARROT_INTERP, REPROps *REPR, PMC *HOW);
typedef INTVAL (* rf) (PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, wrap_object_t, create_stable_t));
#define REGISTER_DYNAMIC_REPR(interp, name, reg_func) \
((rf) \
VTABLE_get_pointer(interp, \
Expand Down

0 comments on commit 3619d77

Please sign in to comment.