Remove dependancy of vm_core.h on shape.h

so that now shape can happily include gc.h
This commit is contained in:
Matt Valentine-House 2023-02-17 14:14:53 +00:00
parent d91a82850a
commit 879cda98a4
Notes: git 2023-04-06 10:07:41 +00:00
5 changed files with 8 additions and 5 deletions

View File

@ -132,8 +132,6 @@ struct rb_objspace; /* in vm_core.h */
# undef RB_NEWOBJ_OF
#endif
#define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX]))
#define RB_RVARGC_NEWOBJ_OF(var, T, c, f, s) \
T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
rb_wb_protected_newobj_of((c), (f) & ~FL_WB_PROTECTED, s) : \

3
iseq.h
View File

@ -11,6 +11,7 @@
**********************************************************************/
#include "internal/gc.h"
#include "shape.h"
#include "vm_core.h"
RUBY_EXTERN const int ruby_api_version[];
@ -325,6 +326,8 @@ VALUE rb_iseq_defined_string(enum defined_type type);
/* vm.c */
VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq);
RUBY_SYMBOL_EXPORT_END
#endif /* RUBY_ISEQ_H */

View File

@ -1,3 +1,4 @@
#include "internal/gc.h"
#include "ruby/ruby.h"
#include "ruby/ractor.h"
#include "vm_core.h"

View File

@ -10,6 +10,8 @@
/* per-object */
#include "shape.h"
struct gen_ivtbl {
#if !SHAPE_IN_BASIC_FLAGS
uint16_t shape_id;
@ -20,7 +22,6 @@ struct gen_ivtbl {
int rb_ivar_generic_ivtbl_lookup(VALUE obj, struct gen_ivtbl **);
#include "shape.h"
#if !SHAPE_IN_BASIC_FLAGS
shape_id_t rb_generic_shape_id(VALUE obj);
#endif

View File

@ -53,6 +53,8 @@
#include "ruby_assert.h"
#define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX]))
#if VM_CHECK_MODE > 0
#define VM_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(VM_CHECK_MODE > 0, expr, #expr)
#define VM_UNREACHABLE(func) rb_bug(#func ": unreachable")
@ -100,7 +102,6 @@ extern int ruby_assert_critical_section_entered;
#include "ruby/st.h"
#include "ruby_atomic.h"
#include "vm_opts.h"
#include "shape.h"
#include "ruby/thread_native.h"
@ -1122,7 +1123,6 @@ rb_iseq_t *rb_iseq_new_with_callback(const struct rb_iseq_new_with_callback_call
VALUE rb_iseq_disasm(const rb_iseq_t *iseq);
int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child);
attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq);
VALUE rb_iseq_coverage(const rb_iseq_t *iseq);