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

ruby-changes:68703

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:12:29 +0900 (JST)
Subject: [ruby-changes:68703] ec42378196 (master): Rename function and variable

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

From ec42378196db02936cd521305dc5940f598370d0 Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Fri, 20 Nov 2020 14:05:36 -0500
Subject: Rename function and variable

---
 ujit_compile.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/ujit_compile.c b/ujit_compile.c
index c75431e9de..45ead62f3b 100644
--- a/ujit_compile.c
+++ b/ujit_compile.c
@@ -56,7 +56,7 @@ typedef struct ctx_struct https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L56
     uint8_t *code_ptr;
 
     // Whether we know self is a heap object
-    bool self_is_heap_object;
+    bool self_is_object;
 
 } ctx_t;
 
@@ -627,18 +627,18 @@ gen_setlocal_wc0(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L627
 
 // Check that `self` is a pointer to an object on the GC heap
 static void
-ensure_self_is_heap_object(codeblock_t *cb, x86opnd_t storage_for_self, uint8_t *side_exit, ctx_t *ctx)
+guard_self_is_object(codeblock_t *cb, x86opnd_t self_opnd, uint8_t *side_exit, ctx_t *ctx)
 {
     // `self` is constant throughout the entire region, so we only need to do this check once.
-    if (!ctx->self_is_heap_object) {
-        test(cb, storage_for_self, imm_opnd(RUBY_IMMEDIATE_MASK));
+    if (!ctx->self_is_object) {
+        test(cb, self_opnd, imm_opnd(RUBY_IMMEDIATE_MASK));
         jnz_ptr(cb, side_exit);
-        cmp(cb, storage_for_self, imm_opnd(Qfalse));
+        cmp(cb, self_opnd, imm_opnd(Qfalse));
         je_ptr(cb, side_exit);
-        cmp(cb, storage_for_self, imm_opnd(Qnil));
+        cmp(cb, self_opnd, imm_opnd(Qnil));
         je_ptr(cb, side_exit);
-        ctx->self_is_heap_object = true;
-    }
+        ctx->self_is_object = true;
+    }   
 }
 
 static bool
@@ -669,7 +669,7 @@ gen_getinstancevariable(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L669
     // Load self from CFP
     mov(cb, REG0, member_opnd(REG_CFP, rb_control_frame_t, self));
 
-    ensure_self_is_heap_object(cb, REG0, side_exit, ctx);
+    guard_self_is_object(cb, REG0, side_exit, ctx);
 
     // Bail if receiver class is different from compiled time call cache class
     x86opnd_t klass_opnd = mem_opnd(64, REG0, offsetof(struct RBasic, klass));
@@ -731,7 +731,7 @@ gen_setinstancevariable(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L731
     // Load self from CFP
     mov(cb, REG0, member_opnd(REG_CFP, rb_control_frame_t, self));
 
-    ensure_self_is_heap_object(cb, REG0, side_exit, ctx);
+    guard_self_is_object(cb, REG0, side_exit, ctx);
 
     // Bail if receiver class is different from compiled time call cache class
     x86opnd_t klass_opnd = mem_opnd(64, REG0, offsetof(struct RBasic, klass));
-- 
cgit v1.2.1


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

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