Skip to content

Commit

Permalink
Improve comments for mapping functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn authored and XrXr committed Oct 20, 2021
1 parent 786e512 commit 5d155fc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion yjit_core.c
Expand Up @@ -163,7 +163,10 @@ int type_diff(val_type_t src, val_type_t dst);


/**
Set the type of an instruction operand
Upgrade (or "learn") the type of an instruction operand
This value must be compatible and at least as specific as the previously known type.
If this value originated from self, or an lvar, the learned type will be
propagated back to its source.
*/
void ctx_upgrade_opnd_type(ctx_t* ctx, insn_opnd_t opnd, val_type_t type)
{
Expand Down Expand Up @@ -197,6 +200,11 @@ void ctx_upgrade_opnd_type(ctx_t* ctx, insn_opnd_t opnd, val_type_t type)
}
}

/*
Get both the type and mapping (where the value originates) of an operand.
This is can be used with ctx_stack_push_mapping or ctx_set_opnd_mapping to copy
a stack value's type while maintaining the mapping.
*/
temp_type_mapping_t
ctx_get_opnd_mapping(const ctx_t* ctx, insn_opnd_t opnd)
{
Expand All @@ -223,6 +231,9 @@ ctx_get_opnd_mapping(const ctx_t* ctx, insn_opnd_t opnd)
return type_mapping;
}

/*
Overwrite both the type and mapping of a stack operand.
*/
void
ctx_set_opnd_mapping(ctx_t* ctx, insn_opnd_t opnd, temp_type_mapping_t type_mapping)
{
Expand Down

0 comments on commit 5d155fc

Please sign in to comment.