[前][次][番号順一覧][スレッド一覧]

ruby-changes:69075

From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:45 +0900 (JST)
Subject: [ruby-changes:69075] 5d155fc8a1 (master): Improve comments for mapping functions

https://git.ruby-lang.org/ruby.git/commit/?id=5d155fc8a1

From 5d155fc8a1c44087142539d51b27410388552599 Mon Sep 17 00:00:00 2001
From: John Hawthorn <john@h...>
Date: Thu, 29 Jul 2021 16:40:07 -0700
Subject: Improve comments for mapping functions

---
 yjit_core.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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); https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L163
 
 
 /**
-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) https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L200
     }
 }
 
+/*
+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) https://github.com/ruby/ruby/blob/trunk/yjit_core.c#L231
     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)
 {
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]