summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2020-11-12 14:25:11 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:26 -0400
commite2e70f69f3af939b0ba687424b6a30043de2ea9e (patch)
tree8ac83ada27e260c74b17c2307cf1ca67ce438180
parentbe91995a5e91c2ad0136e44f553ffdd80342d090 (diff)
Add comment wrt getivar and allocators
-rw-r--r--ujit_compile.c3
1 files changed, 3 insertions, 0 deletions
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)
}
// 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;