summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2022-10-21 12:58:51 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2022-10-21 14:56:48 -0700
commit13bd617ea6fdf72467c593639cf33312a06c330c (patch)
tree9da47089160cfa85d6723256b1e952dcc0843a52 /internal
parent87bb0bee6b9843ea32ca6bb48f9e03b1876b7c48 (diff)
Remove unused class serial
Before object shapes, we were using class serial to invalidate inline caches. Now that we use shape_id for inline cache keys, the class serial is unnecessary. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6605
Diffstat (limited to 'internal')
-rw-r--r--internal/class.h32
-rw-r--r--internal/vm.h1
2 files changed, 2 insertions, 31 deletions
diff --git a/internal/class.h b/internal/class.h
index 4a3e09ddc7..f163b7445c 100644
--- a/internal/class.h
+++ b/internal/class.h
@@ -40,9 +40,6 @@ struct rb_cvar_class_tbl_entry {
struct rb_classext_struct {
struct st_table *iv_tbl;
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
- struct rb_id_table *m_tbl;
-#endif
struct rb_id_table *const_tbl;
struct rb_id_table *callable_m_tbl;
struct rb_id_table *cc_tbl; /* ID -> [[ci, cc1], cc2, ...] */
@@ -57,9 +54,6 @@ struct rb_classext_struct {
* included. Hopefully that makes sense.
*/
struct rb_subclass_entry *module_subclass_entry;
-#if SIZEOF_SERIAL_T != SIZEOF_VALUE && !USE_RVARGC /* otherwise class_serial is in struct RClass */
- rb_serial_t class_serial;
-#endif
const VALUE origin_;
const VALUE refined_class;
rb_alloc_func_t allocator;
@@ -73,19 +67,10 @@ struct rb_classext_struct {
struct RClass {
struct RBasic basic;
VALUE super;
+ struct rb_id_table *m_tbl;
#if !USE_RVARGC
struct rb_classext_struct *ptr;
#endif
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE
- /* Class serial is as wide as VALUE. Place it here. */
- rb_serial_t class_serial;
-#else
- /* Class serial does not fit into struct RClass. Place m_tbl instead. */
- struct rb_id_table *m_tbl;
-# if USE_RVARGC
- rb_serial_t *class_serial_ptr;
-# endif
-#endif
};
typedef struct rb_subclass_entry rb_subclass_entry_t;
@@ -98,25 +83,12 @@ typedef struct rb_classext_struct rb_classext_t;
#endif
#define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE
-# define RCLASS_M_TBL(c) (RCLASS_EXT(c)->m_tbl)
-#else
-# define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
-#endif
+#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
#define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
#define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl)
#define RCLASS_CVC_TBL(c) (RCLASS_EXT(c)->cvc_tbl)
#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
-#if SIZEOF_SERIAL_T == SIZEOF_VALUE
-# define RCLASS_SERIAL(c) (RCLASS(c)->class_serial)
-#else
-# if USE_RVARGC
-# define RCLASS_SERIAL(c) (*RCLASS(c)->class_serial_ptr)
-# else
-# define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
-# endif
-#endif
#define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
#define RCLASS_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->subclass_entry)
#define RCLASS_MODULE_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->module_subclass_entry)
diff --git a/internal/vm.h b/internal/vm.h
index 9480406a2b..cf245c6579 100644
--- a/internal/vm.h
+++ b/internal/vm.h
@@ -40,7 +40,6 @@ enum method_missing_reason {
};
/* vm_insnhelper.h */
-rb_serial_t rb_next_class_serial(void);
VALUE rb_vm_push_frame_fname(struct rb_execution_context_struct *ec, VALUE fname);
/* vm.c */