12 #ifndef RUBY_VM_CORE_H 13 #define RUBY_VM_CORE_H 20 #define VM_CHECK_MODE 0 48 #define VM_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(VM_CHECK_MODE > 0, expr, #expr) 50 #define VM_UNREACHABLE(func) rb_bug(#func ": unreachable") 53 #define VM_ASSERT(expr) ((void)0) 54 #define VM_UNREACHABLE(func) UNREACHABLE 57 #define RUBY_VM_THREAD_MODEL 2 68 #include "ccan/list/list.h" 73 #elif defined(HAVE_PTHREAD_H) 77 #ifndef ENABLE_VM_OBJSPACE 84 #define ENABLE_VM_OBJSPACE 0 86 #define ENABLE_VM_OBJSPACE 1 94 # define NSIG (_SIGMAX + 1) 97 #define RUBY_NSIG NSIG 99 #ifdef HAVE_STDARG_PROTOTYPES 101 #define va_init_list(a,b) va_start((a),(b)) 104 #define va_init_list(a,b) va_start((a)) 107 #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__) 108 #define USE_SIGALTSTACK 116 #if defined(__GNUC__) && __GNUC__ >= 2 118 #if OPT_TOKEN_THREADED_CODE 119 #if OPT_DIRECT_THREADED_CODE 120 #undef OPT_DIRECT_THREADED_CODE 127 #if OPT_DIRECT_THREADED_CODE 128 #undef OPT_DIRECT_THREADED_CODE 130 #if OPT_TOKEN_THREADED_CODE 131 #undef OPT_TOKEN_THREADED_CODE 135 #ifdef __native_client__ 136 #undef OPT_DIRECT_THREADED_CODE 140 #if OPT_CALL_THREADED_CODE 141 #if OPT_DIRECT_THREADED_CODE 142 #undef OPT_DIRECT_THREADED_CODE 144 #if OPT_STACK_CACHING 145 #undef OPT_STACK_CACHING 164 #define TAG_NONE RUBY_TAG_NONE 165 #define TAG_RETURN RUBY_TAG_RETURN 166 #define TAG_BREAK RUBY_TAG_BREAK 167 #define TAG_NEXT RUBY_TAG_NEXT 168 #define TAG_RETRY RUBY_TAG_RETRY 169 #define TAG_REDO RUBY_TAG_REDO 170 #define TAG_RAISE RUBY_TAG_RAISE 171 #define TAG_THROW RUBY_TAG_THROW 172 #define TAG_FATAL RUBY_TAG_FATAL 173 #define TAG_MASK RUBY_TAG_MASK 260 #define CoreDataFromValue(obj, type) (type*)DATA_PTR(obj) 262 #define CoreDataFromValue(obj, type) (type*)rb_data_object_get(obj) 264 #define GetCoreDataFromValue(obj, type, ptr) ((ptr) = CoreDataFromValue((obj), type)) 273 #define PATHOBJ_PATH 0 274 #define PATHOBJ_REALPATH 1 277 pathobj_path(
VALUE pathobj)
289 pathobj_realpath(
VALUE pathobj)
310 ISEQ_TYPE_DEFINED_GUARD
376 const struct rb_iseq_param_keyword {
435 #ifndef USE_LAZY_LOAD 436 #define USE_LAZY_LOAD 0 493 #define GetVMPtr(obj, ptr) \ 494 GetCoreDataFromValue((obj), rb_vm_t, (ptr)) 523 struct list_head waiting_fds;
524 struct list_head living_threads;
593 #define RUBY_VM_SIZE_ALIGN 4096 595 #define RUBY_VM_THREAD_VM_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) 596 #define RUBY_VM_THREAD_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) 597 #define RUBY_VM_THREAD_MACHINE_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) 598 #define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) 600 #define RUBY_VM_FIBER_VM_STACK_SIZE ( 16 * 1024 * sizeof(VALUE)) 601 #define RUBY_VM_FIBER_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) 602 #define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 64 * 1024 * sizeof(VALUE)) 603 #define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) 606 #define INTEGER_REDEFINED_OP_FLAG (1 << 0) 607 #define FLOAT_REDEFINED_OP_FLAG (1 << 1) 608 #define STRING_REDEFINED_OP_FLAG (1 << 2) 609 #define ARRAY_REDEFINED_OP_FLAG (1 << 3) 610 #define HASH_REDEFINED_OP_FLAG (1 << 4) 612 #define SYMBOL_REDEFINED_OP_FLAG (1 << 6) 613 #define TIME_REDEFINED_OP_FLAG (1 << 7) 614 #define REGEXP_REDEFINED_OP_FLAG (1 << 8) 615 #define NIL_REDEFINED_OP_FLAG (1 << 9) 616 #define TRUE_REDEFINED_OP_FLAG (1 << 10) 617 #define FALSE_REDEFINED_OP_FLAG (1 << 11) 619 #define BASIC_OP_UNREDEFINED_P(op, klass) (LIKELY((GET_VM()->redefined_flag[(op)]&(klass)) == 0)) 621 #ifndef VM_DEBUG_BP_CHECK 622 #define VM_DEBUG_BP_CHECK 0 625 #ifndef VM_DEBUG_VERIFY_METHOD_CACHE 626 #define VM_DEBUG_VERIFY_METHOD_CACHE (VM_DEBUG_MODE != 0) 670 #if VM_DEBUG_BP_CHECK 678 rb_thread_ptr(
VALUE thval)
777 VALUE *register_stack_start;
778 VALUE *register_stack_end;
779 size_t register_stack_maxsize;
786 struct list_node vmlt_node;
809 #ifdef NON_SCALAR_THREAD_ID 823 #if OPT_CALL_THREADED_CODE 859 #ifdef USE_SIGALTSTACK 874 #define VM_DEFINECLASS_TYPE(x) ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK) 875 #define VM_DEFINECLASS_FLAG_SCOPED 0x08 876 #define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS 0x10 877 #define VM_DEFINECLASS_SCOPED_P(x) ((x) & VM_DEFINECLASS_FLAG_SCOPED) 878 #define VM_DEFINECLASS_HAS_SUPERCLASS_P(x) \ 879 ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS) 907 #define GetProcPtr(obj, ptr) \ 908 GetCoreDataFromValue((obj), rb_proc_t, (ptr)) 927 #define GetBindingPtr(obj, ptr) \ 928 GetCoreDataFromValue((obj), rb_binding_t, (ptr)) 944 #define VM_CHECKMATCH_TYPE_MASK 0x03 945 #define VM_CHECKMATCH_ARRAY 0x04 962 #define VM_CALL_ARGS_SPLAT (0x01 << VM_CALL_ARGS_SPLAT_bit) 963 #define VM_CALL_ARGS_BLOCKARG (0x01 << VM_CALL_ARGS_BLOCKARG_bit) 964 #define VM_CALL_FCALL (0x01 << VM_CALL_FCALL_bit) 965 #define VM_CALL_VCALL (0x01 << VM_CALL_VCALL_bit) 966 #define VM_CALL_ARGS_SIMPLE (0x01 << VM_CALL_ARGS_SIMPLE_bit) 967 #define VM_CALL_BLOCKISEQ (0x01 << VM_CALL_BLOCKISEQ_bit) 968 #define VM_CALL_KWARG (0x01 << VM_CALL_KWARG_bit) 969 #define VM_CALL_KW_SPLAT (0x01 << VM_CALL_KW_SPLAT_bit) 970 #define VM_CALL_TAILCALL (0x01 << VM_CALL_TAILCALL_bit) 971 #define VM_CALL_SUPER (0x01 << VM_CALL_SUPER_bit) 972 #define VM_CALL_OPT_SEND (0x01 << VM_CALL_OPT_SEND_bit) 997 #ifndef FUNC_FASTCALL 998 #define FUNC_FASTCALL(x) x 1004 #define VM_TAGGED_PTR_SET(p, tag) ((VALUE)(p) | (tag)) 1005 #define VM_TAGGED_PTR_REF(v, mask) ((void *)((v) & ~mask)) 1007 #define GC_GUARDED_PTR(p) VM_TAGGED_PTR_SET((p), 0x01) 1008 #define GC_GUARDED_PTR_REF(p) VM_TAGGED_PTR_REF((p), 0x03) 1009 #define GC_GUARDED_PTR_P(p) (((VALUE)(p)) & 0x01) 1047 #define VM_ENV_DATA_SIZE ( 3) 1049 #define VM_ENV_DATA_INDEX_ME_CREF (-2) 1050 #define VM_ENV_DATA_INDEX_SPECVAL (-1) 1051 #define VM_ENV_DATA_INDEX_FLAGS ( 0) 1052 #define VM_ENV_DATA_INDEX_ENV ( 1) 1053 #define VM_ENV_DATA_INDEX_ENV_PROC ( 2) 1055 #define VM_ENV_INDEX_LAST_LVAR (-VM_ENV_DATA_SIZE) 1057 static inline void VM_FORCE_WRITE_SPECIAL_CONST(
const VALUE *ptr,
VALUE special_const_value);
1060 VM_ENV_FLAGS_SET(
const VALUE *ep,
VALUE flag)
1068 VM_ENV_FLAGS_UNSET(
const VALUE *ep,
VALUE flag)
1075 static inline unsigned long 1076 VM_ENV_FLAGS(
const VALUE *ep,
long flag)
1080 return flags & flag;
1083 static inline unsigned long 1108 rb_obj_is_iseq(
VALUE iseq)
1113 #if VM_CHECK_MODE > 0 1114 #define RUBY_VM_NORMAL_ISEQ_P(iseq) rb_obj_is_iseq((VALUE)iseq) 1128 return !VM_FRAME_CFRAME_P(cfp);
1131 #define RUBYVM_CFUNC_FRAME_P(cfp) \ 1132 (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC) 1134 #define VM_GUARDED_PREV_EP(ep) GC_GUARDED_PTR(ep) 1135 #define VM_BLOCK_HANDLER_NONE 0 1138 VM_ENV_LOCAL_P(
const VALUE *ep)
1143 static inline const VALUE *
1144 VM_ENV_PREV_EP(
const VALUE *ep)
1151 VM_ENV_BLOCK_HANDLER(
const VALUE *ep)
1157 #if VM_CHECK_MODE > 0 1158 int rb_vm_ep_in_heap_p(
const VALUE *ep);
1162 VM_ENV_ESCAPED_P(
const VALUE *ep)
1168 #if VM_CHECK_MODE > 0 1170 vm_assert_env(
VALUE obj)
1178 VM_ENV_ENVVAL(
const VALUE *ep)
1187 VM_ENV_ENVVAL_PTR(
const VALUE *ep)
1189 return (
const rb_env_t *)VM_ENV_ENVVAL(ep);
1193 VM_ENV_PROCVAL(
const VALUE *ep)
1214 *((
VALUE *)ptr) = v;
1218 VM_FORCE_WRITE_SPECIAL_CONST(
const VALUE *ptr,
VALUE special_const_value)
1221 VM_FORCE_WRITE(ptr, special_const_value);
1228 VM_FORCE_WRITE(&ep[index], v);
1238 #define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) ((cfp)+1) 1239 #define RUBY_VM_NEXT_CONTROL_FRAME(cfp) ((cfp)-1) 1240 #define RUBY_VM_END_CONTROL_FRAME(th) \ 1241 ((rb_control_frame_t *)((th)->ec.vm_stack + (th)->ec.vm_stack_size)) 1242 #define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) \ 1243 ((void *)(ecfp) > (void *)(cfp)) 1244 #define RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp) \ 1245 (!RUBY_VM_VALID_CONTROL_FRAME_P((cfp), RUBY_VM_END_CONTROL_FRAME(th))) 1248 VM_BH_ISEQ_BLOCK_P(
VALUE block_handler)
1250 if ((block_handler & 0x03) == 0x01) {
1251 #if VM_CHECK_MODE > 0 1266 VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler));
1267 return block_handler;
1271 VM_BH_TO_ISEQ_BLOCK(
VALUE block_handler)
1274 VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler));
1279 VM_BH_IFUNC_P(
VALUE block_handler)
1281 if ((block_handler & 0x03) == 0x03) {
1282 #if VM_CHECK_MODE > 0 1297 VM_ASSERT(VM_BH_IFUNC_P(block_handler));
1298 return block_handler;
1302 VM_BH_TO_IFUNC_BLOCK(
VALUE block_handler)
1305 VM_ASSERT(VM_BH_IFUNC_P(block_handler));
1310 VM_BH_TO_CAPT_BLOCK(
VALUE block_handler)
1313 VM_ASSERT(VM_BH_IFUNC_P(block_handler) || VM_BH_ISEQ_BLOCK_P(block_handler));
1318 vm_block_handler_type(
VALUE block_handler)
1320 if (VM_BH_ISEQ_BLOCK_P(block_handler)) {
1323 else if (VM_BH_IFUNC_P(block_handler)) {
1326 else if (
SYMBOL_P(block_handler)) {
1339 (vm_block_handler_type(block_handler), 1));
1343 vm_block_type(
const struct rb_block *block)
1345 #if VM_CHECK_MODE > 0 1346 switch (block->
type) {
1371 static inline const struct rb_block *
1372 vm_proc_block(
VALUE procval)
1379 static inline const VALUE *vm_block_ep(
const struct rb_block *block);
1382 vm_proc_iseq(
VALUE procval)
1384 return vm_block_iseq(vm_proc_block(procval));
1387 static inline const VALUE *
1388 vm_proc_ep(
VALUE procval)
1390 return vm_block_ep(vm_proc_block(procval));
1394 vm_block_iseq(
const struct rb_block *block)
1396 switch (vm_block_type(block)) {
1406 static inline const VALUE *
1407 vm_block_ep(
const struct rb_block *block)
1409 switch (vm_block_type(block)) {
1420 vm_block_self(
const struct rb_block *block)
1422 switch (vm_block_type(block)) {
1427 return vm_block_self(vm_proc_block(block->
as.
proc));
1436 VM_BH_TO_SYMBOL(
VALUE block_handler)
1439 return block_handler;
1450 VM_BH_TO_PROC(
VALUE block_handler)
1453 return block_handler;
1457 VM_BH_FROM_PROC(
VALUE procval)
1473 #define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->ec.cfp) 1474 #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp)) 1510 rb_vm_living_threads_init(
rb_vm_t *vm)
1543 #define rb_vm_register_special_exception(sp, e, m) \ 1544 rb_vm_register_special_exception_str(sp, e, rb_usascii_str_new_static((m), (long)rb_strlen_lit(m))) 1554 #define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack] 1556 #define RUBY_CONST_ASSERT(expr) (1/!!(expr)) 1557 #define VM_STACK_OVERFLOWED_P(cfp, sp, margin) \ 1558 (!RUBY_CONST_ASSERT(sizeof(*(sp)) == sizeof(VALUE)) || \ 1559 !RUBY_CONST_ASSERT(sizeof(*(cfp)) == sizeof(rb_control_frame_t)) || \ 1560 ((rb_control_frame_t *)((sp) + (margin)) + 1) >= (cfp)) 1561 #define WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) \ 1562 if (LIKELY(!VM_STACK_OVERFLOWED_P(cfp, sp, margin))) {(void)0;} else 1563 #define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin) \ 1564 WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) vm_stackoverflow() 1565 #define CHECK_VM_STACK_OVERFLOW(cfp, margin) \ 1566 WHEN_VM_STACK_OVERFLOWED(cfp, (cfp)->sp, margin) vm_stackoverflow() 1572 #if RUBY_VM_THREAD_MODEL == 2 1582 #define GET_VM() ruby_current_vm 1583 #define GET_THREAD() ruby_current_thread 1585 #define rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th)) 1586 #define rb_thread_set_current(th) do { \ 1587 if ((th)->vm->running_thread != (th)) { \ 1588 (th)->running_time_us = 0; \ 1590 rb_thread_set_current_raw(th); \ 1591 (th)->vm->running_thread = (th); \ 1595 #error "unsupported thread model" 1605 #define RUBY_VM_SET_TIMER_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TIMER_INTERRUPT_MASK) 1606 #define RUBY_VM_SET_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, PENDING_INTERRUPT_MASK) 1607 #define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK) 1608 #define RUBY_VM_SET_TRAP_INTERRUPT(th) ATOMIC_OR((th)->interrupt_flag, TRAP_INTERRUPT_MASK) 1609 #define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & ~(th)->interrupt_mask & (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK)) 1610 #define RUBY_VM_INTERRUPTED_ANY(th) ((th)->interrupt_flag & ~(th)->interrupt_mask) 1627 #define RUBY_VM_CHECK_INTS(th) ruby_vm_check_ints(th) 1657 #define EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, called_id_, klass_, data_, pop_p_) do { \ 1658 const rb_event_flag_t flag_arg_ = (flag_); \ 1659 if (UNLIKELY(ruby_vm_event_flags & (flag_arg_))) { \ 1661 ruby_exec_event_hook_orig(th_, flag_arg_, self_, id_, called_id_, klass_, data_, pop_p_); \ 1671 trace_arg.
event = flag;
1674 trace_arg.
self =
self;
1686 #define EXEC_EVENT_HOOK(th_, flag_, self_, id_, called_id_, klass_, data_) \ 1687 EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, called_id_, klass_, data_, 0) 1689 #define EXEC_EVENT_HOOK_AND_POP_FRAME(th_, flag_, self_, id_, called_id_, klass_, data_) \ 1690 EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, called_id_, klass_, data_, 1) void rb_thread_stop_timer_thread(void)
void rb_objspace_free(struct rb_objspace *)
rb_thread_list_t * join_list
union iseq_inline_storage_entry * is_entries
struct rb_ensure_entry rb_ensure_entry_t
VALUE rb_get_coverages(void)
VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
void rb_threadptr_pending_interrupt_clear(rb_thread_t *th)
void rb_threadptr_signal_raise(rb_thread_t *th, int sig)
const VALUE * default_values
VALUE passed_block_handler
void rb_postponed_job_flush(rb_vm_t *vm)
void rb_gc_mark_machine_stack(const rb_execution_context_t *ec)
struct rb_thread_struct * running_thread
void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th)
int pending_interrupt_queue_checked
const rb_callable_method_entry_t * me
VALUE rb_proc_alloc(VALUE klass)
STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0)
struct rb_trace_arg_struct * trace_arg
VALUE rb_iseq_disasm(const rb_iseq_t *iseq)
VALUE rb_iseq_eval_main(const rb_iseq_t *iseq)
VALUE local_storage_recursive_hash_for_trace
struct rb_thread_struct * th
void rb_unblock_function_t(void *)
void rb_thread_start_timer_thread(void)
VALUE rb_vm_frame_block_handler(const rb_control_frame_t *cfp)
rb_unblock_function_t * func
struct iseq_compile_data * compile_data
struct st_table * loaded_features_index
struct list_node vmlt_node
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
rb_iseq_t * rb_iseq_compile(VALUE src, VALUE file, VALUE line)
VALUE pending_interrupt_mask_stack
const rb_callable_method_entry_t * rb_vm_frame_method_entry(const rb_control_frame_t *cfp)
RUBY_EXTERN VALUE rb_cRubyVM
#define VM_ENV_DATA_INDEX_ENV_PROC
VALUE rb_thread_alloc(VALUE klass)
const rb_data_type_t ruby_binding_data_type
int rb_autoloading_value(VALUE mod, ID id, VALUE *value)
#define VM_BLOCK_HANDLER_NONE
#define RB_SPECIAL_CONST_P(x)
size_t fiber_machine_stack_size
unsigned int report_on_exception
struct rb_iseq_constant_body * body
rb_vm_t * ruby_current_vm
void ruby_thread_init_stack(rb_thread_t *th)
rb_ensure_list_t * ensure_list
st_table * frozen_strings
struct rb_call_info_kw_arg * kw_arg
rb_at_exit_list * at_exit
#define VM_TAGGED_PTR_REF(v, mask)
struct rb_hook_list_struct rb_hook_list_t
RUBY_SYMBOL_EXPORT_BEGIN rb_thread_t * ruby_current_thread
struct rb_vm_protect_tag * prev
VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr)
rb_iseq_t * rb_iseq_new_main(NODE *node, VALUE path, VALUE realpath, const rb_iseq_t *parent)
struct rb_control_frame_struct rb_control_frame_t
rb_vm_at_exit_func * func
const VALUE * rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars)
VALUE rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method)
VALUE rb_vm_make_proc(rb_thread_t *th, const struct rb_captured_block *captured, VALUE klass)
struct rb_thread_list_struct rb_thread_list_t
void rb_vm_rewrite_cref(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr)
void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *)
void rb_set_coverages(VALUE, int)
int rb_threadptr_pending_interrupt_active_p(rb_thread_t *th)
void rb_vm_stack_to_heap(rb_thread_t *th)
const VALUE * iseq_encoded
VALUE rb_vm_env_local_variables(const rb_env_t *env)
rb_control_frame_t * rb_vm_get_binding_creatable_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp)
unsigned int thread_abort_on_exception
#define RB_TYPE_P(obj, type)
VALUE defined_module_hash
#define RUBY_VM_INTERRUPTED_ANY(th)
void rb_thread_reset_timer_thread(void)
VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp, const VALUE *_pc)
unsigned short first_lineno
void rb_bug_context(const void *ctx, const char *fmt,...)
void rb_thread_wakeup_timer_thread(void)
VALUE(* vm_call_handler)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
unsigned int local_table_size
struct st_table * ensure_rollback_table
RUBY_SYMBOL_EXPORT_BEGIN rb_iseq_t * rb_iseq_new(NODE *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum iseq_type)
RUBY_SYMBOL_EXPORT_END VALUE rb_iseq_pathobj_new(VALUE path, VALUE realpath)
struct rb_call_info * ci_entries
void rb_signal_exec(rb_thread_t *th, int sig)
size_t fiber_vm_stack_size
struct rb_vm_struct rb_vm_t
void * blocking_region_buffer
void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg)
void rb_vm_rewind_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
VALUE load_path_check_cache
struct rb_ensure_list rb_ensure_list_t
void rb_threadptr_exec_event_hooks_and_pop_frame(struct rb_trace_arg_struct *trace_arg)
VALUE rb_iseq_realpath(const rb_iseq_t *iseq)
#define offsetof(p_type, field)
struct st_table * loading_table
void rb_vm_block_copy(VALUE obj, const struct rb_block *dst, const struct rb_block *src)
struct rb_iseq_location_struct rb_iseq_location_t
union rb_captured_block::@141 code
VALUE rb_iseq_coverage(const rb_iseq_t *iseq)
void rb_execution_context_mark(const rb_execution_context_t *ec)
void rb_threadptr_signal_exit(rb_thread_t *th)
rb_iseq_t * rb_iseq_new_top(NODE *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent)
struct rb_event_hook_struct * hooks
#define VM_ENV_DATA_INDEX_SPECVAL
int rb_signal_buff_size(void)
const char * ruby_node_name(int node)
VALUE local_storage_recursive_hash
rb_hook_list_t event_hooks
void rb_vm_pop_frame(rb_thread_t *th)
struct rb_call_cache * cc_entries
VALUE rb_obj_is_proc(VALUE)
struct rb_mutex_struct * keeping_mutexes
unsigned long rb_serial_t
VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt)
VALUE rb_vm_make_proc_lambda(rb_thread_t *th, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda)
NORETURN(void rb_bug_context(const void *, const char *fmt,...))
unsigned int ambiguous_param0
#define RUBY_SYMBOL_EXPORT_END
rb_event_flag_t ruby_vm_event_flags
void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v)
struct list_head waiting_fds
unsigned char buf[MIME_BUF_SIZE]
size_t thread_vm_stack_size
void rb_vm_bugreport(const void *)
VALUE rb_vm_make_binding(rb_thread_t *th, const rb_control_frame_t *src_cfp)
rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp)
struct rb_vm_protect_tag * protect_tag
int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child)
Disassemble a instruction Iseq -> Iseq inspect object.
IFUNC (Internal FUNCtion)
const rb_data_type_t ruby_threadptr_data_type
struct rb_thread_struct * main_thread
int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp)
#define RUBY_SYMBOL_EXPORT_BEGIN
RUBY_SYMBOL_EXPORT_BEGIN int rb_thread_check_trap_pending(void)
struct rb_at_exit_list * next
#define VM_ENV_DATA_INDEX_FLAGS
const struct vm_ifunc * ifunc
rb_atomic_t interrupt_flag
struct rb_calling_info * calling
int rb_backtrace_iter_func(void *, VALUE, int, VALUE)
VALUE rb_binding_alloc(VALUE klass)
struct rb_ensure_list * next
union iseq_inline_cache_entry::@132 ic_value
const rb_callable_method_entry_t * passed_bmethod_me
struct rb_captured_block captured
struct rb_at_exit_list rb_at_exit_list
#define VM_ENV_DATA_INDEX_ENV
void rb_iseq_pathobj_set(const rb_iseq_t *iseq, VALUE path, VALUE realpath)
void rb_vm_change_state(void)
const rb_cref_t * ic_cref
rb_iseq_t * rb_iseq_compile_on_base(VALUE src, VALUE file, VALUE line, const struct rb_block *base_block)
void rb_vm_gvl_destroy(rb_vm_t *vm)
struct rb_objspace * objspace
void rb_vm_block_ep_update(VALUE obj, const struct rb_block *dst, const VALUE *ep)
const struct iseq_catch_table * catch_table
#define RARRAY_AREF(a, i)
struct rb_execution_context_struct rb_execution_context_t
unsigned long interrupt_mask
void rb_threadptr_interrupt(rb_thread_t *th)
unsigned int abort_on_exception
rb_hook_list_t event_hooks
struct rb_iseq_struct * local_iseq
rb_nativethread_id_t thread_id
void rb_threadptr_error_print(rb_thread_t *volatile th, volatile VALUE errinfo)
rb_nativethread_lock_t thread_destruct_lock
rb_control_frame_t *FUNC_FASTCALL rb_insn_func_t(rb_thread_t *, rb_control_frame_t *)
struct rb_call_cache * CALL_CACHE
struct iseq_inline_cache_entry * IC
const VALUE * rb_vm_ep_local_ep(const VALUE *ep)
native_thread_data_t native_thread_data
size_t thread_machine_stack_size
struct rb_thread_struct * running_thread
unsigned int thread_report_on_exception
#define VM_UNREACHABLE(func)
void rb_reset_coverages(void)
void rb_vm_at_exit_func(struct rb_vm_struct *)
const rb_env_t * rb_vm_env_prev_env(const rb_env_t *env)
int rb_vm_get_sourceline(const rb_control_frame_t *)
void rb_vm_inc_const_missing_count(void)
VALUE loaded_features_snapshot
const struct rb_iseq_struct * parent_iseq
int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, ID *called_idp, VALUE *klassp)
rb_execution_context_t ec
const struct iseq_line_info_entry * line_info_table
char rb_thread_id_string_t[sizeof(rb_nativethread_id_t) *2+3]
void rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp)
struct rb_objspace * rb_objspace_alloc(void)
rb_iseq_t * rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_iseq_t *parent, enum iseq_type, const rb_compile_option_t *)
const VALUE * rb_vm_proc_local_ep(VALUE proc)
unsigned int line_info_size
struct rb_thread_list_struct * next
struct rb_thread_struct rb_thread_t
struct list_head living_threads
#define RTYPEDDATA_DATA(v)
struct rb_call_info * CALL_INFO
rb_iseq_t * rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, const struct rb_block *base_block, VALUE opt)
#define GC_GUARDED_PTR_REF(p)
struct rb_postponed_job_struct * postponed_job_buffer
VALUE rb_iseq_path(const rb_iseq_t *iseq)
rb_nativethread_lock_t interrupt_lock
void rb_threadptr_check_signal(rb_thread_t *mth)
void rb_threadptr_exec_event_hooks(struct rb_trace_arg_struct *trace_arg)
VALUE pending_interrupt_queue
RUBY_EXTERN VALUE rb_mRubyVMFrozenCore
void rb_threadptr_execute_interrupts(rb_thread_t *, int)
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_eval(const rb_iseq_t *iseq)
RUBY_EXTERN VALUE rb_cISeq
VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, int argc, const VALUE *argv, VALUE block_handler)
void * rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type)
rb_iseq_location_t location
#define VM_TAGGED_PTR_SET(p, tag)