summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-10-11 17:06:41 -0700
committerAaron Patterson <tenderlove@ruby-lang.org>2019-12-05 13:37:02 -0800
commit2c8d186c6e4fd03ea57466fa6dce6bad40d09401 (patch)
tree06b3ae0ce2946092b0bb667d4df30dcf05cc5b19 /vm_core.h
parent38b7f947a2c76aad29a2e42f3bd0848854d96519 (diff)
Introduce an "Inline IVAR cache" struct
This commit introduces an "inline ivar cache" struct. The reason we need this is so compaction can differentiate from an ivar cache and a regular inline cache. Regular inline caches contain references to `VALUE` and ivar caches just contain references to the ivar index. With this new struct we can easily update references for inline caches (but not inline var caches as they just contain an int)
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/vm_core.h b/vm_core.h
index b0787aaa7a..f7ec156cc5 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -220,10 +220,12 @@ typedef struct rb_compile_option_struct rb_compile_option_t;
struct iseq_inline_cache_entry {
rb_serial_t ic_serial;
const rb_cref_t *ic_cref;
- union {
- size_t index;
- VALUE value;
- } ic_value;
+ VALUE value;
+};
+
+struct iseq_inline_iv_cache_entry {
+ rb_serial_t ic_serial;
+ size_t index;
};
union iseq_inline_storage_entry {
@@ -232,6 +234,7 @@ union iseq_inline_storage_entry {
VALUE value;
} once;
struct iseq_inline_cache_entry cache;
+ struct iseq_inline_iv_cache_entry iv_cache;
};
struct rb_call_info_kw_arg {
@@ -1122,6 +1125,7 @@ enum vm_svar_index {
/* inline cache */
typedef struct iseq_inline_cache_entry *IC;
+typedef struct iseq_inline_iv_cache_entry *IVC;
typedef union iseq_inline_storage_entry *ISE;
typedef struct rb_call_info *CALL_INFO;
typedef struct rb_call_cache *CALL_CACHE;