From 13bd617ea6fdf72467c593639cf33312a06c330c Mon Sep 17 00:00:00 2001 From: Jemma Issroff Date: Fri, 21 Oct 2022 12:58:51 -0400 Subject: 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 --- internal/class.h | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'internal/class.h') 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) -- cgit v1.2.3