NAME
src/pmc/callcontext.pmc - CallContext PMC
DESCRIPTION
The CallContext PMC is used to store the argument list and argument meta information for a multiple dispatch call.
Functions
static void ensure_positionals_storage(PARROT_INTERP, PMC *self, INTVAL size)
Ensure that static void ensure_positionals_storage_ap(PARROT_INTERP, PMC *self, INTVAL size, INTVAL allocated_positionals)
Allocate a new chunk of memory that can contain static Pcc_cell* get_cell_at(PARROT_INTERP, PMC *self, INTVAL key)
Return the cell indexed by static INTVAL autobox_intval(PARROT_INTERP, const Pcc_cell *cell)
Return static FLOATVAL autobox_floatval(PARROT_INTERP, const Pcc_cell *cell)
Return static STRING * autobox_string(PARROT_INTERP, const Pcc_cell *cell)
Return static PMC * autobox_pmc(PARROT_INTERP, Pcc_cell *cell, INTVAL type)
Return static Hash * get_hash(PARROT_INTERP, PMC *SELF)
Return the hash for this CallContext,
creating a hash if necessary.
static void mark_cell(PARROT_INTERP, Pcc_cell *c)
Mark this cell's GCable,
if needed.
static void mark_positionals(PARROT_INTERP, PMC *self)
Mark this positional's GCables,
if needed.
static void mark_hash(PARROT_INTERP, Hash *h)
Mark this hash's GCables,
if needed.
static PMC * get_named_names(PARROT_INTERP, PMC *SELF)
Return all named arguments in a FixedStringArray.
void init()
Initializes a newly created CallContext object.
void mark()
Mark any referenced strings and PMCs.
void morph(PMC *type)
Morph the call signature into a return signature.
(Currently ignores the type passed in,
and resets the named and positional arguments stored.)
void set_string_native(STRING *value)
Sets the short signature for the CallContext.
STRING *get_string()
Returns the short signature for the CallContext.
void set_pmc(PMC *value)
Sets a fixed-size array of integer types (a type tuple) for the CallContext.
PMC *get_pmc()
Returns a fixed-size array of integer types (a type tuple) for the CallContext.
void set_attr_str(STRING *key, PMC *value)
Set a PMC value for an attribute by string name.
- results Stores the return signature, an array of PMCs.
- arg_flags Stores a set of flags for the call signature arguments, an array of integers.
- return_flags Stores a set of flags for the call signature return arguments, an array of integers.
PMC *get_attr_str(STRING *key)
Get a PMC value for an attribute by string name.
- results Retrieves the return signature, an array of PMCs.
- arg_flags Retrieves the flags for the call signature arguments, an array of integers.
- return_flags Retrieves the flags for the call signature return arguments, an array of integers.
- named Retrieves the hash of named arguments.
- caller_ctx return Caller Context
- lex_pad return LexPad
- outer_ctx return Outer Context
- current_sub return current Sub
- handlers return list of ExceptionHandlers
- current_cont return current Continuation
- current_namespace return current Namespace
PMC *clone()
Creates and returns a clone of the signature.
PMC *backtrace
Gets a representation of the backtrace starting from this Context.
Returns an array of hashes.
Each array element represents a caller in the backtrace,
the most recent caller first.
The hash has two keys:
self
has enough storage space for size
positionals.
allocated_positionals
entries,
either from the fixed size allocator or from system memory,
and free the the old chunk (if needed).
key
.
cell
as an INTVAL.
cell
as an FLOATVAL.
cell
as an STRING.
cell
as a PMC.
sub
,
which holds the PMC representing the sub,
and annotations
which is a hash of the annotations at the point where the exception was thrown for the current sub,
or for the point of the call a level deeper for the rest.