parrotcode: Parrot Object | |
Contents | PMCs |
classes/ - Parrot Object
A Parrot Object is reasonably simple. It's data pointer points to an array with the attributes of the object in it. The int cache value holds the offset in that array of the first attribute, so we can front-load the array with invisible options.
The array holds:
The object is actually constructed by the instantiation code in src/objects.c, at least for right now.
void init()
new
on the registered class PMC and not the ParrotObject itself.Parrot_class_register()
this init()
method gets replaced by Parrot_instantiate_object()
.void init_pmc(PMC *init)
void init_pmc_props(PMC *init, PMC *props)
init()
.
The arguments are ignored.PMC *find_method(STRING *name)
*name
.PMC *get_attr(INTVAL idx)
idx
.PMC *get_attr_str(STRING *name)
name
.void set_attr(INTVAL idx, PMC *val)
idx
.void set_attr_str(STRING *name, PMC *val)
name
.PMC *get_class()
void visit(visit_info *info)
*info
is the visit info,
(see include/parrot/pmc_freeze.h).void freeze(visit_info *info)
void thaw(visit_info *info)
void thawfinish(visit_info *info)
|