mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
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>
This commit is contained in:
parent
87bb0bee6b
commit
13bd617ea6
Notes:
git
2022-10-21 21:57:08 +00:00
7 changed files with 3 additions and 57 deletions
|
@ -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)
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue