Skip to content

Commit

Permalink
Add in a first take on the 6model-specific ops. Largly copied from NQ…
Browse files Browse the repository at this point in the history
…P, but I didn't bring over ops that were NQP or Rakudo specific. Some ops regarding serialization contexts need more clarification about where they belong. Do 6model initialization in interp setup instead of requiring a dynop
  • Loading branch information
Whiteknight committed Aug 27, 2011
1 parent 62fc1b7 commit ffd67ce
Show file tree
Hide file tree
Showing 4 changed files with 992 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/parrot/interpreter.h
Expand Up @@ -169,6 +169,7 @@ struct parrot_interp_t {
VTABLE **vtables; /* array of vtable ptrs */
int n_vtable_max; /* highest used type */
int n_vtable_alloced; /* alloced vtable space */
INTVAL *om_type_cache; /* Easy cache for accessing 6model types */

struct _ParrotIOData *piodata; /* interpreter's IO system */

Expand Down Expand Up @@ -281,6 +282,8 @@ typedef enum {
IGLOBALS_PBC_LIBS, /* Hash of load_bytecode cde */
IGLOBALS_EXECUTABLE, /* How Parrot was invoked (from argv[0]) */
IGLOBALS_LOADED_PBCS, /* Hash of .pbc file -> PackfileView */
IGLOBALS_KNOWHOW,
IGLOBALS_KNOWHOWATTRIBUTE,

IGLOBALS_SIZE
} iglobals_enum;
Expand Down
4 changes: 4 additions & 0 deletions include/parrot/parrot.h
Expand Up @@ -267,6 +267,10 @@ typedef struct PackFile_ByteCode PackFile_ByteCode;
#include "parrot/hll.h"
#include "parrot/pbcversion.h"

#include "parrot/6model/sixmodelobject.h"
#include "parrot/6model/repr_registry.h"
#include "parrot/6model/serialization_context.h"

#endif /* PARROT_PARROT_H_GUARD */

/*
Expand Down
11 changes: 11 additions & 0 deletions src/interp/inter_create.c
Expand Up @@ -345,9 +345,20 @@ initialize_interpreter(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args))
Parrot_x_on_exit(interp, Parrot_really_destroy, NULL);
#endif

int_initialize_6model(interp);
return interp;
}

static void
int_initialize_6model(PARROT_INTERP)
{
PMC * KnowHOW, KnowHOWAttribute;
SixModelObject_initialize(interp, &KnowHOW, &KnowHOWAttribute);
VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_KNOWHOW, KnowHOW);
VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_KNOWHOWATTRIBUTE,
KnowHOWAttribute);
}


/*
Expand Down

0 comments on commit ffd67ce

Please sign in to comment.