Revert "Revert "This commit implements the Object Shapes technique in CRuby.""

This reverts commit 9a6803c90b.
This commit is contained in:
Jemma Issroff 2022-10-03 11:14:32 -04:00 committed by Aaron Patterson
parent 5ffbb2be18
commit ad63b668e2
No known key found for this signature in database
GPG key ID: 953170BCB4FFAFC6
41 changed files with 2311 additions and 893 deletions

View file

@ -9,11 +9,6 @@
* @brief Internal header for Object.
*/
#include "ruby/ruby.h" /* for VALUE */
#include "internal/class.h" /* for RCLASS_IV_INDEX_TBL */
#ifdef ROBJECT_IV_INDEX_TBL
# undef ROBJECT_IV_INDEX_TBL
#endif
/* object.c */
VALUE rb_class_search_ancestor(VALUE klass, VALUE super);
@ -26,7 +21,6 @@ int rb_bool_expected(VALUE, const char *, int raise);
static inline void RBASIC_CLEAR_CLASS(VALUE obj);
static inline void RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass);
static inline void RBASIC_SET_CLASS(VALUE obj, VALUE klass);
static inline struct st_table *ROBJECT_IV_INDEX_TBL_inline(VALUE obj);
RUBY_SYMBOL_EXPORT_BEGIN
/* object.c (export) */
@ -64,20 +58,4 @@ RBASIC_SET_CLASS(VALUE obj, VALUE klass)
RBASIC_SET_CLASS_RAW(obj, klass);
RB_OBJ_WRITTEN(obj, oldv, klass);
}
RBIMPL_ATTR_PURE()
static inline struct st_table *
ROBJECT_IV_INDEX_TBL_inline(VALUE obj)
{
if (RB_FL_ANY_RAW(obj, ROBJECT_EMBED)) {
VALUE klass = rb_obj_class(obj);
return RCLASS_IV_INDEX_TBL(klass);
}
else {
const struct RObject *const ptr = ROBJECT(obj);
return ptr->as.heap.iv_index_tbl;
}
}
#define ROBJECT_IV_INDEX_TBL ROBJECT_IV_INDEX_TBL_inline
#endif /* INTERNAL_OBJECT_H */