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

ruby-changes:68658

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:12:00 +0900 (JST)
Subject: [ruby-changes:68658] e2e70f69f3 (master): Add comment wrt getivar and allocators

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

From e2e70f69f3af939b0ba687424b6a30043de2ea9e Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Thu, 12 Nov 2020 14:25:11 -0500
Subject: Add comment wrt getivar and allocators

---
 ujit_compile.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ujit_compile.c b/ujit_compile.c
index 923eb85e19..2520932ad1 100644
--- a/ujit_compile.c
+++ b/ujit_compile.c
@@ -636,6 +636,9 @@ gen_getinstancevariable(codeblock_t* cb, codeblock_t* ocb, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L636
     }
 
     // If the class uses the default allocator, instances should all be T_OBJECT
+    // NOTE: This assumes nobody changes the allocator of the class after allocation.
+    //       Eventually, we can encode whether an object is T_OBJECT or not
+    //       inside object shapes.
     if (rb_get_alloc_func(ic->entry->class_value) != rb_class_allocate_instance)
     {
         return false;
-- 
cgit v1.2.1


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

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