diff --git a/bignum.c b/bignum.c index b72b18ad08a..d95444a5637 100644 --- a/bignum.c +++ b/bignum.c @@ -45,6 +45,7 @@ #include "ruby/thread.h" #include "ruby/util.h" #include "ruby_assert.h" +#include "vm_core.h" /* for GET_EC() */ #if USE_GMP RBIMPL_WARNING_PUSH() diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index 6a565789952..1d85835ba53 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -9,6 +9,7 @@ ************************************************/ #include "rubysocket.h" +#include // GETADDRINFO_IMPL == 0 : call getaddrinfo/getnameinfo directly // GETADDRINFO_IMPL == 1 : call getaddrinfo/getnameinfo without gvl (but uncancellable) diff --git a/internal/box.h b/internal/box.h index 1958b8dca6b..1e7d4fbdef5 100644 --- a/internal/box.h +++ b/internal/box.h @@ -94,4 +94,8 @@ void rb_box_cleanup_local_extension(VALUE cleanup); void rb_initialize_mandatory_boxes(void); void rb_box_init_done(void); void rb_box_set_gem_flags(rb_box_gem_flags_t *); + +/* variable.c */ +void rb_autoload_copy_table_for_box(st_table *, const rb_box_t *); + #endif /* INTERNAL_BOX_H */ diff --git a/internal/gc.h b/internal/gc.h index 9a137d26095..706610f35ee 100644 --- a/internal/gc.h +++ b/internal/gc.h @@ -14,7 +14,7 @@ #include "internal/compilers.h" /* for __has_attribute */ #include "ruby/ruby.h" /* for rb_event_flag_t */ -#include "vm_core.h" /* for GET_EC() */ +#include "ruby_atomic.h" /* for RUBY_ATOMIC_VALUE_SET */ struct rb_gc_zjit_fastpath; @@ -121,6 +121,7 @@ const char *rb_raw_obj_info(char *const buff, const size_t buff_size, VALUE obj) struct rb_execution_context_struct; /* in vm_core.h */ struct rb_objspace; /* in vm_core.h */ +struct rb_ractor_struct; /* in vm_core.h */ #define EC_NEWOBJ_OF(var, T, c, f, s, ec) \ T *(var) = (T *)rb_ec_newobj_of((ec), (c), (f), s) @@ -200,9 +201,10 @@ void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t); RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add_mul(size_t, size_t, size_t, size_t); RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t); void rb_gc_register_pinning_obj(VALUE obj); -rb_execution_context_t *rb_gc_get_ec(void); +struct rb_execution_context_struct *rb_gc_get_ec(void); +VALUE rb_newobj_of_unprotected(VALUE klass, VALUE flags, size_t size); -void *rb_gc_ractor_cache_alloc(rb_ractor_t *ractor); +void *rb_gc_ractor_cache_alloc(struct rb_ractor_struct *ractor); void rb_gc_ractor_cache_free(void *cache); bool rb_gc_zjit_new_obj_fastpath(size_t alloc_size, VALUE flags, VALUE klass, struct rb_gc_zjit_fastpath *fastpath); diff --git a/internal/thread.h b/internal/thread.h index ea891b4372f..ad5b645c932 100644 --- a/internal/thread.h +++ b/internal/thread.h @@ -12,6 +12,7 @@ #include "ruby/intern.h" /* for rb_blocking_function_t */ #include "ccan/list/list.h" /* for list in rb_io_close_wait_list */ +struct rb_execution_context_struct; /* in vm_core.h */ struct rb_thread_struct; /* in vm_core.h */ struct rb_io; diff --git a/memory_view.c b/memory_view.c index f8d7508f68c..2c088e7dab5 100644 --- a/memory_view.c +++ b/memory_view.c @@ -9,6 +9,7 @@ #include "internal.h" #include "internal/hash.h" #include "internal/variable.h" +#include "internal/vm.h" #include "ruby/memory_view.h" #include "ruby/util.h" #include "vm_sync.h" diff --git a/node.c b/node.c index 5d00823eb67..2521e554e0f 100644 --- a/node.c +++ b/node.c @@ -11,11 +11,12 @@ #ifdef UNIVERSAL_PARSER #include -#include "node.h" #include "rubyparser.h" #endif +#include "internal.h" #include "internal/variable.h" +#include "node.h" #define NODE_BUF_DEFAULT_SIZE (sizeof(struct RNode) * 16) diff --git a/numeric.c b/numeric.c index cb7b4932e96..0760312e0ea 100644 --- a/numeric.c +++ b/numeric.c @@ -39,6 +39,7 @@ #include "internal/string.h" #include "internal/util.h" #include "internal/variable.h" +#include "vm_core.h" #include "ruby/encoding.h" #include "ruby/util.h" #include "builtin.h" diff --git a/parse.y b/parse.y index 2afeb620974..f55b6374fef 100644 --- a/parse.y +++ b/parse.y @@ -24,6 +24,7 @@ #endif #include "ruby/internal/config.h" +#include "internal/thread.h" #include @@ -41,11 +42,13 @@ #else #include "internal.h" +#include "internal/array.h" #include "internal/compile.h" #include "internal/compilers.h" #include "internal/complex.h" #include "internal/encoding.h" #include "internal/error.h" +#include "internal/gc.h" #include "internal/hash.h" #include "internal/io.h" #include "internal/numeric.h" @@ -55,7 +58,6 @@ #include "internal/ruby_parser.h" #include "internal/symbol.h" #include "internal/thread.h" -#include "internal/variable.h" #include "node.h" #include "parser_node.h" #include "probes.h" diff --git a/rational.c b/rational.c index f40c412506e..30c3e6daffc 100644 --- a/rational.c +++ b/rational.c @@ -33,6 +33,7 @@ #include "internal/object.h" #include "internal/rational.h" #include "ruby_assert.h" +#include "vm_core.h" /* for GET_EC() */ #if USE_GMP RBIMPL_WARNING_PUSH() diff --git a/shape.h b/shape.h index 68fd4a7c9f3..2a416b1b126 100644 --- a/shape.h +++ b/shape.h @@ -2,6 +2,7 @@ #define RUBY_SHAPE_H #include "internal/gc.h" +#include "internal/imemo.h" typedef uint8_t attr_index_t; typedef uint32_t shape_id_t; diff --git a/string.c b/string.c index 18c31812c71..bc5434ef6ae 100644 --- a/string.c +++ b/string.c @@ -49,6 +49,7 @@ #include "ruby/ractor.h" #include "ruby_assert.h" #include "shape.h" +#include "vm_core.h" #include "vm_sync.h" #include "zjit.h" #include "ruby/internal/attr/nonstring.h" diff --git a/symbol.c b/symbol.c index e8a1a177b0f..48e3569c8fb 100644 --- a/symbol.c +++ b/symbol.c @@ -24,6 +24,7 @@ #include "ruby/ractor.h" #include "ruby/st.h" #include "symbol.h" +#include "vm_core.h" #include "vm_sync.h" #include "builtin.h" #include "ruby/internal/attr/nonstring.h" diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs index 659c0af223b..753955c8aff 100644 --- a/yjit/src/cruby_bindings.inc.rs +++ b/yjit/src/cruby_bindings.inc.rs @@ -153,6 +153,7 @@ impl ::std::cmp::PartialEq for __BindgenUnionField { } } impl ::std::cmp::Eq for __BindgenUnionField {} +pub const SHAPE_ID_NUM_BITS: u32 = 32; pub const INTEGER_REDEFINED_OP_FLAG: u32 = 1; pub const FLOAT_REDEFINED_OP_FLAG: u32 = 2; pub const STRING_REDEFINED_OP_FLAG: u32 = 4; @@ -171,7 +172,6 @@ pub const VM_ENV_DATA_INDEX_ME_CREF: i32 = -2; pub const VM_ENV_DATA_INDEX_SPECVAL: i32 = -1; pub const VM_ENV_DATA_INDEX_FLAGS: u32 = 0; pub const VM_BLOCK_HANDLER_NONE: u32 = 0; -pub const SHAPE_ID_NUM_BITS: u32 = 32; pub type ID = ::std::os::raw::c_ulong; pub type rb_alloc_func_t = ::std::option::Option VALUE>; pub const RUBY_Qfalse: ruby_special_consts = 0; @@ -300,6 +300,42 @@ pub const RUBY_ENCINDEX_EUC_JP: ruby_preserved_encindex = 10; pub const RUBY_ENCINDEX_Windows_31J: ruby_preserved_encindex = 11; pub const RUBY_ENCINDEX_BUILTIN_MAX: ruby_preserved_encindex = 12; pub type ruby_preserved_encindex = u32; +pub type rb_atomic_t = ::std::os::raw::c_uint; +pub const imemo_env: imemo_type = 0; +pub const imemo_cref: imemo_type = 1; +pub const imemo_svar: imemo_type = 2; +pub const imemo_throw_data: imemo_type = 3; +pub const imemo_ifunc: imemo_type = 4; +pub const imemo_memo: imemo_type = 5; +pub const imemo_ment: imemo_type = 6; +pub const imemo_iseq: imemo_type = 7; +pub const imemo_tmpbuf: imemo_type = 8; +pub const imemo_cvar_entry: imemo_type = 9; +pub const imemo_callinfo: imemo_type = 10; +pub const imemo_callcache: imemo_type = 11; +pub const imemo_constcache: imemo_type = 12; +pub const imemo_fields: imemo_type = 13; +pub const imemo_subclasses: imemo_type = 14; +pub const imemo_cdhash: imemo_type = 15; +pub type imemo_type = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct vm_ifunc_argc { + pub min: ::std::os::raw::c_int, + pub max: ::std::os::raw::c_int, +} +#[repr(C)] +pub struct vm_ifunc { + pub flags: VALUE, + pub svar_lep: *mut VALUE, + pub func: rb_block_call_func_t, + pub data: *const ::std::os::raw::c_void, + pub argc: vm_ifunc_argc, +} +pub type attr_index_t = u8; +pub type shape_id_t = u32; +pub const SHAPE_ID_HAS_IVAR_MASK: shape_id_mask = 67633150; +pub type shape_id_mask = u32; pub const BOP_PLUS: ruby_basic_operators = 0; pub const BOP_MINUS: ruby_basic_operators = 1; pub const BOP_MULT: ruby_basic_operators = 2; @@ -339,38 +375,6 @@ pub const BOP_YIELD: ruby_basic_operators = 35; pub const BOP_LAST_: ruby_basic_operators = 36; pub type ruby_basic_operators = u32; pub type rb_serial_t = ::std::os::raw::c_ulonglong; -pub const imemo_env: imemo_type = 0; -pub const imemo_cref: imemo_type = 1; -pub const imemo_svar: imemo_type = 2; -pub const imemo_throw_data: imemo_type = 3; -pub const imemo_ifunc: imemo_type = 4; -pub const imemo_memo: imemo_type = 5; -pub const imemo_ment: imemo_type = 6; -pub const imemo_iseq: imemo_type = 7; -pub const imemo_tmpbuf: imemo_type = 8; -pub const imemo_cvar_entry: imemo_type = 9; -pub const imemo_callinfo: imemo_type = 10; -pub const imemo_callcache: imemo_type = 11; -pub const imemo_constcache: imemo_type = 12; -pub const imemo_fields: imemo_type = 13; -pub const imemo_subclasses: imemo_type = 14; -pub const imemo_cdhash: imemo_type = 15; -pub type imemo_type = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct vm_ifunc_argc { - pub min: ::std::os::raw::c_int, - pub max: ::std::os::raw::c_int, -} -#[repr(C)] -pub struct vm_ifunc { - pub flags: VALUE, - pub svar_lep: *mut VALUE, - pub func: rb_block_call_func_t, - pub data: *const ::std::os::raw::c_void, - pub argc: vm_ifunc_argc, -} -pub type rb_atomic_t = ::std::os::raw::c_uint; pub const METHOD_VISI_UNDEF: rb_method_visibility_t = 0; pub const METHOD_VISI_PUBLIC: rb_method_visibility_t = 1; pub const METHOD_VISI_PRIVATE: rb_method_visibility_t = 2; @@ -645,10 +649,6 @@ pub const VM_ENV_FLAG_ESCAPED: vm_frame_env_flags = 4; pub const VM_ENV_FLAG_WB_REQUIRED: vm_frame_env_flags = 8; pub const VM_ENV_FLAG_ISOLATED: vm_frame_env_flags = 16; pub type vm_frame_env_flags = u32; -pub type attr_index_t = u8; -pub type shape_id_t = u32; -pub const SHAPE_ID_HAS_IVAR_MASK: shape_id_mask = 67633150; -pub type shape_id_mask = u32; #[repr(C)] pub struct rb_cvar_class_tbl_entry { pub imemo_flags: VALUE, @@ -1098,6 +1098,8 @@ extern "C" { elements: *const VALUE, opt: ::std::os::raw::c_int, ) -> VALUE; + pub fn rb_obj_info(obj: VALUE) -> *const ::std::os::raw::c_char; + pub fn rb_ec_stack_check(ec: *mut rb_execution_context_struct) -> ::std::os::raw::c_int; pub fn rb_ary_tmp_new_from_values( arg1: VALUE, arg2: ::std::os::raw::c_long, @@ -1108,6 +1110,14 @@ extern "C" { n: ::std::os::raw::c_long, elts: *const VALUE, ) -> VALUE; + pub fn rb_shape_id_offset() -> i32; + pub fn rb_obj_shape_id(obj: VALUE) -> shape_id_t; + pub fn rb_shape_get_iv_index(shape_id: shape_id_t, id: ID, value: *mut attr_index_t) -> bool; + pub fn rb_shape_transition_add_ivar_no_warnings( + shape_id: shape_id_t, + id: ID, + klass: VALUE, + ) -> shape_id_t; pub fn rb_vm_top_self() -> VALUE; pub static mut rb_vm_insn_count: u64; pub fn rb_method_entry_at(obj: VALUE, id: ID) -> *const rb_method_entry_t; @@ -1126,16 +1136,6 @@ extern "C" { pub fn rb_vm_frame_method_entry( cfp: *const rb_control_frame_t, ) -> *const rb_callable_method_entry_t; - pub fn rb_obj_info(obj: VALUE) -> *const ::std::os::raw::c_char; - pub fn rb_ec_stack_check(ec: *mut rb_execution_context_struct) -> ::std::os::raw::c_int; - pub fn rb_shape_id_offset() -> i32; - pub fn rb_obj_shape_id(obj: VALUE) -> shape_id_t; - pub fn rb_shape_get_iv_index(shape_id: shape_id_t, id: ID, value: *mut attr_index_t) -> bool; - pub fn rb_shape_transition_add_ivar_no_warnings( - shape_id: shape_id_t, - id: ID, - klass: VALUE, - ) -> shape_id_t; pub fn rb_ivar_get_at(obj: VALUE, index: attr_index_t, id: ID) -> VALUE; pub fn rb_ivar_get_at_no_ractor_check(obj: VALUE, index: attr_index_t) -> VALUE; pub fn rb_gvar_get(arg1: ID) -> VALUE; diff --git a/zjit/src/cruby_bindings.inc.rs b/zjit/src/cruby_bindings.inc.rs index 5bce8574e81..3e84f0d4eb5 100644 --- a/zjit/src/cruby_bindings.inc.rs +++ b/zjit/src/cruby_bindings.inc.rs @@ -215,6 +215,7 @@ pub const ONIG_OPTION_EXTEND: u32 = 2; pub const ONIG_OPTION_MULTILINE: u32 = 4; pub const ARG_ENCODING_FIXED: u32 = 16; pub const ARG_ENCODING_NONE: u32 = 32; +pub const SHAPE_ID_NUM_BITS: u32 = 32; pub const INTEGER_REDEFINED_OP_FLAG: u32 = 1; pub const FLOAT_REDEFINED_OP_FLAG: u32 = 2; pub const STRING_REDEFINED_OP_FLAG: u32 = 4; @@ -233,7 +234,6 @@ pub const VM_ENV_DATA_INDEX_ME_CREF: i32 = -2; pub const VM_ENV_DATA_INDEX_SPECVAL: i32 = -1; pub const VM_ENV_DATA_INDEX_FLAGS: u32 = 0; pub const VM_BLOCK_HANDLER_NONE: u32 = 0; -pub const SHAPE_ID_NUM_BITS: u32 = 32; pub const ZJIT_STACK_MAP_VREG_TAG: u32 = 8; pub const ZJIT_STACK_MAP_SKIP_TAG: u32 = 16; pub const ZJIT_STACK_MAP_SHIFT: u32 = 8; @@ -403,6 +403,60 @@ pub const RUBY_ENCINDEX_EUC_JP: ruby_preserved_encindex = 10; pub const RUBY_ENCINDEX_Windows_31J: ruby_preserved_encindex = 11; pub const RUBY_ENCINDEX_BUILTIN_MAX: ruby_preserved_encindex = 12; pub type ruby_preserved_encindex = u32; +pub type rb_atomic_t = ::std::os::raw::c_uint; +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct rb_id_table { + pub _bindgen_opaque_blob: [u64; 3usize], +} +pub const imemo_env: imemo_type = 0; +pub const imemo_cref: imemo_type = 1; +pub const imemo_svar: imemo_type = 2; +pub const imemo_throw_data: imemo_type = 3; +pub const imemo_ifunc: imemo_type = 4; +pub const imemo_memo: imemo_type = 5; +pub const imemo_ment: imemo_type = 6; +pub const imemo_iseq: imemo_type = 7; +pub const imemo_tmpbuf: imemo_type = 8; +pub const imemo_cvar_entry: imemo_type = 9; +pub const imemo_callinfo: imemo_type = 10; +pub const imemo_callcache: imemo_type = 11; +pub const imemo_constcache: imemo_type = 12; +pub const imemo_fields: imemo_type = 13; +pub const imemo_subclasses: imemo_type = 14; +pub const imemo_cdhash: imemo_type = 15; +pub type imemo_type = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct vm_ifunc_argc { + pub min: ::std::os::raw::c_int, + pub max: ::std::os::raw::c_int, +} +#[repr(C)] +pub struct vm_ifunc { + pub flags: VALUE, + pub svar_lep: *mut VALUE, + pub func: rb_block_call_func_t, + pub data: *const ::std::os::raw::c_void, + pub argc: vm_ifunc_argc, +} +pub type attr_index_t = u8; +pub type shape_id_t = u32; +pub const SHAPE_ID_CAPACITY_MASK: shape_id_fl_type = 66584576; +pub const SHAPE_ID_FL_COMPLEX: shape_id_fl_type = 67108864; +pub const SHAPE_ID_FL_FROZEN: shape_id_fl_type = 134217728; +pub const SHAPE_ID_FL_HAS_OBJECT_ID: shape_id_fl_type = 268435456; +pub const SHAPE_ID_LAYOUT_ROBJECT: shape_id_fl_type = 0; +pub const SHAPE_ID_LAYOUT_RCLASS: shape_id_fl_type = 536870912; +pub const SHAPE_ID_LAYOUT_EXTENDED: shape_id_fl_type = 1073741824; +pub const SHAPE_ID_LAYOUT_RDATA: shape_id_fl_type = 1073741824; +pub const SHAPE_ID_LAYOUT_OTHER: shape_id_fl_type = 1610612736; +pub const SHAPE_ID_LAYOUT_MASK: shape_id_fl_type = 1610612736; +pub const SHAPE_ID_FL_NON_CANONICAL_MASK: shape_id_fl_type = 402653184; +pub const SHAPE_ID_FLAGS_MASK: shape_id_fl_type = 2146959360; +pub const SHAPE_ID_FL_PRIVATE_MASK: shape_id_fl_type = 1677197312; +pub type shape_id_fl_type = u32; pub const BOP_PLUS: ruby_basic_operators = 0; pub const BOP_MINUS: ruby_basic_operators = 1; pub const BOP_MULT: ruby_basic_operators = 2; @@ -442,44 +496,6 @@ pub const BOP_YIELD: ruby_basic_operators = 35; pub const BOP_LAST_: ruby_basic_operators = 36; pub type ruby_basic_operators = u32; pub type rb_serial_t = ::std::os::raw::c_ulonglong; -#[repr(C)] -#[repr(align(8))] -#[derive(Debug, Copy, Clone)] -pub struct rb_id_table { - pub _bindgen_opaque_blob: [u64; 3usize], -} -pub const imemo_env: imemo_type = 0; -pub const imemo_cref: imemo_type = 1; -pub const imemo_svar: imemo_type = 2; -pub const imemo_throw_data: imemo_type = 3; -pub const imemo_ifunc: imemo_type = 4; -pub const imemo_memo: imemo_type = 5; -pub const imemo_ment: imemo_type = 6; -pub const imemo_iseq: imemo_type = 7; -pub const imemo_tmpbuf: imemo_type = 8; -pub const imemo_cvar_entry: imemo_type = 9; -pub const imemo_callinfo: imemo_type = 10; -pub const imemo_callcache: imemo_type = 11; -pub const imemo_constcache: imemo_type = 12; -pub const imemo_fields: imemo_type = 13; -pub const imemo_subclasses: imemo_type = 14; -pub const imemo_cdhash: imemo_type = 15; -pub type imemo_type = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct vm_ifunc_argc { - pub min: ::std::os::raw::c_int, - pub max: ::std::os::raw::c_int, -} -#[repr(C)] -pub struct vm_ifunc { - pub flags: VALUE, - pub svar_lep: *mut VALUE, - pub func: rb_block_call_func_t, - pub data: *const ::std::os::raw::c_void, - pub argc: vm_ifunc_argc, -} -pub type rb_atomic_t = ::std::os::raw::c_uint; pub const METHOD_VISI_UNDEF: rb_method_visibility_t = 0; pub const METHOD_VISI_PUBLIC: rb_method_visibility_t = 1; pub const METHOD_VISI_PRIVATE: rb_method_visibility_t = 2; @@ -1541,22 +1557,6 @@ pub const VM_ENV_FLAG_ESCAPED: vm_frame_env_flags = 4; pub const VM_ENV_FLAG_WB_REQUIRED: vm_frame_env_flags = 8; pub const VM_ENV_FLAG_ISOLATED: vm_frame_env_flags = 16; pub type vm_frame_env_flags = u32; -pub type attr_index_t = u8; -pub type shape_id_t = u32; -pub const SHAPE_ID_CAPACITY_MASK: shape_id_fl_type = 66584576; -pub const SHAPE_ID_FL_COMPLEX: shape_id_fl_type = 67108864; -pub const SHAPE_ID_FL_FROZEN: shape_id_fl_type = 134217728; -pub const SHAPE_ID_FL_HAS_OBJECT_ID: shape_id_fl_type = 268435456; -pub const SHAPE_ID_LAYOUT_ROBJECT: shape_id_fl_type = 0; -pub const SHAPE_ID_LAYOUT_RCLASS: shape_id_fl_type = 536870912; -pub const SHAPE_ID_LAYOUT_EXTENDED: shape_id_fl_type = 1073741824; -pub const SHAPE_ID_LAYOUT_RDATA: shape_id_fl_type = 1073741824; -pub const SHAPE_ID_LAYOUT_OTHER: shape_id_fl_type = 1610612736; -pub const SHAPE_ID_LAYOUT_MASK: shape_id_fl_type = 1610612736; -pub const SHAPE_ID_FL_NON_CANONICAL_MASK: shape_id_fl_type = 402653184; -pub const SHAPE_ID_FLAGS_MASK: shape_id_fl_type = 2146959360; -pub const SHAPE_ID_FL_PRIVATE_MASK: shape_id_fl_type = 1677197312; -pub type shape_id_fl_type = u32; pub const CONST_DEPRECATED: rb_const_flag_t = 256; pub const CONST_VISIBILITY_MASK: rb_const_flag_t = 255; pub const CONST_PUBLIC: rb_const_flag_t = 0; @@ -2176,6 +2176,19 @@ unsafe extern "C" { elements: *const VALUE, opt: ::std::os::raw::c_int, ) -> VALUE; + pub fn rb_obj_info(obj: VALUE) -> *const ::std::os::raw::c_char; + pub fn rb_raw_obj_info( + buff: *mut ::std::os::raw::c_char, + buff_size: usize, + obj: VALUE, + ) -> *const ::std::os::raw::c_char; + pub fn rb_ec_stack_check(ec: *mut rb_execution_context_struct) -> ::std::os::raw::c_int; + pub fn rb_gc_writebarrier_remember(obj: VALUE); + pub fn rb_id_table_lookup( + tbl: *mut rb_id_table, + id: ID, + valp: *mut VALUE, + ) -> ::std::os::raw::c_int; pub fn rb_ary_tmp_new_from_values( arg1: VALUE, arg2: ::std::os::raw::c_long, @@ -2186,13 +2199,16 @@ unsafe extern "C" { n: ::std::os::raw::c_long, elts: *const VALUE, ) -> VALUE; + pub fn rb_shape_id_offset() -> i32; + pub fn rb_obj_shape_id(obj: VALUE) -> shape_id_t; + pub fn rb_shape_get_iv_index(shape_id: shape_id_t, id: ID, value: *mut attr_index_t) -> bool; + pub fn rb_shape_transition_add_ivar_no_warnings( + shape_id: shape_id_t, + id: ID, + klass: VALUE, + ) -> shape_id_t; pub fn rb_vm_top_self() -> VALUE; pub static mut rb_vm_insn_count: u64; - pub fn rb_id_table_lookup( - tbl: *mut rb_id_table, - id: ID, - valp: *mut VALUE, - ) -> ::std::os::raw::c_int; pub fn rb_method_entry_at(obj: VALUE, id: ID) -> *const rb_method_entry_t; pub fn rb_callable_method_entry(klass: VALUE, id: ID) -> *const rb_callable_method_entry_t; pub fn rb_callable_method_entry_or_negative( @@ -2210,22 +2226,6 @@ unsafe extern "C" { pub fn rb_vm_frame_method_entry( cfp: *const rb_control_frame_t, ) -> *const rb_callable_method_entry_t; - pub fn rb_obj_info(obj: VALUE) -> *const ::std::os::raw::c_char; - pub fn rb_raw_obj_info( - buff: *mut ::std::os::raw::c_char, - buff_size: usize, - obj: VALUE, - ) -> *const ::std::os::raw::c_char; - pub fn rb_ec_stack_check(ec: *mut rb_execution_context_struct) -> ::std::os::raw::c_int; - pub fn rb_gc_writebarrier_remember(obj: VALUE); - pub fn rb_shape_id_offset() -> i32; - pub fn rb_obj_shape_id(obj: VALUE) -> shape_id_t; - pub fn rb_shape_get_iv_index(shape_id: shape_id_t, id: ID, value: *mut attr_index_t) -> bool; - pub fn rb_shape_transition_add_ivar_no_warnings( - shape_id: shape_id_t, - id: ID, - klass: VALUE, - ) -> shape_id_t; pub fn rb_const_lookup(klass: VALUE, id: ID) -> *mut rb_const_entry_t; pub fn rb_ivar_get_at_no_ractor_check(obj: VALUE, index: attr_index_t) -> VALUE; pub fn rb_gvar_get(arg1: ID) -> VALUE;