From 3409690957ae57822ef18189c006068476c035ff Mon Sep 17 00:00:00 2001 From: tmm1 Date: Fri, 20 Dec 2013 05:10:07 +0000 Subject: ruby.h: swap iv_index_tbl and super for struct RClass * include/ruby/ruby.h (struct RClass): add super, remove iv_index_tbl. since RCLASS_SUPER() is commonly used inside while loops, we move it back inside struct RClass to improve cache hits. this provides a small improvement (1%) in hotspots like rb_obj_is_kind_of() * internal.h (struct rb_classext_struct): remove super, add iv_index_table * internal.h (RCLASS_SUPER): update for new location * internal.h (RCLASS_SET_SUPER): ditto * internal.h (RCLASS_IV_INDEX_TBL): ditto * object.c (rb_class_get_superclass): ditto * include/ruby/backward/classext.h (RCLASS_SUPER): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/backward/classext.h | 2 +- include/ruby/ruby.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/ruby/backward/classext.h b/include/ruby/backward/classext.h index 615e6f6858..33f3b014b8 100644 --- a/include/ruby/backward/classext.h +++ b/include/ruby/backward/classext.h @@ -13,6 +13,6 @@ typedef struct rb_deprecated_classext_struct { #undef RCLASS_SUPER(c) #define RCLASS_EXT(c) ((rb_deprecated_classext_t *)RCLASS(c)->ptr) -#define RCLASS_SUPER(c) (RCLASS_EXT(c)->super) +#define RCLASS_SUPER(c) (RCLASS(c)->super) #endif /* RUBY_BACKWARD_CLASSEXT_H */ diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 9af062ec94..03b9bd0d1a 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -789,9 +789,9 @@ typedef struct rb_classext_struct rb_classext_t; struct RClass { struct RBasic basic; + VALUE super; rb_classext_t *ptr; struct method_table_wrapper *m_tbl_wrapper; - struct st_table *iv_index_tbl; }; #define RCLASS_SUPER(c) rb_class_get_superclass(c) #define RMODULE_IV_TBL(m) RCLASS_IV_TBL(m) -- cgit v1.2.3