NAME

oo.c - Class and object

DESCRIPTION

Handles class and object manipulation.

Functions

void Parrot_oo_extract_methods_from_namespace
Extract methods and vtable overrides from the given namespace and insert them into the class.
PMC *Parrot_oo_get_namespace
Lookup a namespace object from a class PMC.
PMC *Parrot_oo_get_class
Lookup a class object from a namespace, string, or key PMC.
PMC *Parrot_oo_get_class_str
Lookup a class object from a builtin string.
PMC *Parrot_oo_newclass_from_str
Create a new class object from a string name.
PMC *Parrot_oo_find_vtable_override_for_class
Lookup a vtable override in a specific class object.
PMC *Parrot_oo_find_vtable_override
Lookup a vtable override in a class, including any vtable overrides inherited from parents.
INTVAL Parrot_get_vtable_index
Return index if name is a valid vtable slot name.
const char *Parrot_MMD_method_name
Return the method name for the given MMD enum.{{**DEPRECATE**}}
static INTVAL fail_if_type_exists
This function throws an exception if a PMC or class with the same name * already exists in the global type registry. The global type registry will go away eventually, but this allows the new object metamodel to interact with the old one until it does.
INTVAL Parrot_oo_register_type
This function registers a type in the global registry, first checking if it already exists. The global type registry will go away eventually, but this allows the new object metamodel to interact with the old one until it does.
void mark_object_cache
Marks all PMCs in the object method cache as live. This shouldn't strictly be necessary, as they're likely all reachable from namespaces and classes, but it's unlikely to hurt anything except mark phase performance.
void init_object_cache
Allocate memory for object cache.
void destroy_object_cache
RT #48260: Not yet documented!!!
static void invalidate_type_caches
RT #48260: Not yet documented!!!
static void invalidate_all_caches
RT #48260: Not yet documented!!!
void Parrot_invalidate_method_cache
Clear method cache for the given class. If class is NULL, caches for all classes are invalidated.
PMC *Parrot_find_method_direct
Find a method PMC for a named method, given the class PMC, current interpreter, and name of the method. Don't use a possible method cache.
PMC *Parrot_find_method_with_cache
Find a method PMC for a named method, given the class PMC, current interp, and name of the method.This routine should use the current scope's method cache, if there is one. If not, it creates a new method cache. Or, rather, it will when we've got that bit working. For now it unconditionally goes and looks up the name in the global stash.
static void debug_trace_find_meth
RT #48260: Not yet documented!!!
static PMC *find_method_direct_1
RT #48260: Not yet documented!!!
static PMC *C3_merge
RT #48260: Not yet documented!!!
PMC *Parrot_ComputeMRO_C3
Computes the C3 linearization for the given class.
void Parrot_ComposeRole
Used by the Class and Object PMCs internally to compose a role into either of them. The role parameter is the role that we are composing into the class or role. methods_hash is the hash of method names to invokable PMCs that contains the methods the class or role has. roles_list is the list of roles the the class or method does.The role parameter is only dealt with by its external interface. Whether this routine is usable by any other object system implemented in Parrot very much depends on how closely the role composition semantics they want are to the default implementation.

SEE ALSO

include/parrot/oo.h, include/parrot/oo_private.h, docs/pdds/pdd15_objects.pod.