summaryrefslogtreecommitdiff
path: root/yjit_core.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2021-07-29 16:40:07 -0700
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:38 -0400
commit5d155fc8a1c44087142539d51b27410388552599 (patch)
treeda3c22d2a4da901b6dbaab709450b6f3700e4cd5 /yjit_core.c
parent786e51217806de2d5ba2eb62154045abdfa9771a (diff)
Improve comments for mapping functions
Diffstat (limited to 'yjit_core.c')
-rw-r--r--yjit_core.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/yjit_core.c b/yjit_core.c
index 07da8f6723..0d9464e0bd 100644
--- a/yjit_core.c
+++ b/yjit_core.c
@@ -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)
{
@@ -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)
{
@@ -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)
{