Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

# vm_core.h File Reference

`#include "ruby/ruby.h"`
`#include "ruby/st.h"`
`#include "node.h"`
`#include "debug.h"`
`#include "vm_opts.h"`
`#include "id.h"`
`#include "method.h"`
`#include <setjmp.h>`
`#include <signal.h>`
`#include <varargs.h>`
Include dependency graph for vm_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | rb_compile_option_struct
struct | iseq_inline_cache_entry
struct | rb_iseq_struct
struct | rb_vm_struct
struct | rb_control_frame_t
struct | rb_block_struct
struct | rb_vm_tag
struct | rb_vm_protect_tag
struct | rb_unblock_callback
struct | rb_thread_struct
struct | rb_proc_t
struct | rb_env_t
struct | rb_binding_t
## Defines
#define | RUBY_VM_THREAD_MODEL 2
#define | ENABLE_VM_OBJSPACE 1
#define | NSIG (_SIGMAX + 1)
#define | RUBY_NSIG NSIG
#define | va_init_list(a, b) va_start(a)
#define | LIKELY(x) (x)
#define | UNLIKELY(x) (x)
#define | UNINITIALIZED_VAR(x) x
#define | GetCoreDataFromValue(obj, type, ptr)
#define | GetISeqPtr(obj, ptr) GetCoreDataFromValue(obj, rb_iseq_t, ptr)
#define | GetVMPtr(obj, ptr) GetCoreDataFromValue(obj, rb_vm_t, ptr)
#define | GetThreadPtr(obj, ptr) GetCoreDataFromValue(obj, rb_thread_t, ptr)
#define | RUBY_VM_VALUE_CACHE_SIZE 0x1000
#define | USE_VALUE_CACHE 0
#define | RUBY_VM_THREAD_STACK_SIZE (128 * 1024)
#define | GetProcPtr(obj, ptr) GetCoreDataFromValue(obj, rb_proc_t, ptr)
#define | GetEnvPtr(obj, ptr) GetCoreDataFromValue(obj, rb_env_t, ptr)
#define | GetBindingPtr(obj, ptr) GetCoreDataFromValue(obj, rb_binding_t, ptr)
#define | VM_CALL_ARGS_SPLAT_BIT (0x01 << 1)
#define | VM_CALL_ARGS_BLOCKARG_BIT (0x01 << 2)
#define | VM_CALL_FCALL_BIT (0x01 << 3)
#define | VM_CALL_VCALL_BIT (0x01 << 4)
#define | VM_CALL_TAILCALL_BIT (0x01 << 5)
#define | VM_CALL_TAILRECURSION_BIT (0x01 << 6)
#define | VM_CALL_SUPER_BIT (0x01 << 7)
#define | VM_CALL_OPT_SEND_BIT (0x01 << 8)
#define | VM_SPECIAL_OBJECT_VMCORE 0x01
#define | VM_SPECIAL_OBJECT_CBASE 0x02
#define | VM_SPECIAL_OBJECT_CONST_BASE 0x03
#define | VM_FRAME_MAGIC_METHOD 0x11
#define | VM_FRAME_MAGIC_BLOCK 0x21
#define | VM_FRAME_MAGIC_CLASS 0x31
#define | VM_FRAME_MAGIC_TOP 0x41
#define | VM_FRAME_MAGIC_FINISH 0x51
#define | VM_FRAME_MAGIC_CFUNC 0x61
#define | VM_FRAME_MAGIC_PROC 0x71
#define | VM_FRAME_MAGIC_IFUNC 0x81
#define | VM_FRAME_MAGIC_EVAL 0x91
#define | VM_FRAME_MAGIC_LAMBDA 0xa1
#define | VM_FRAME_MAGIC_MASK_BITS 8
#define | VM_FRAME_MAGIC_MASK (~(~0<<VM_FRAME_MAGIC_MASK_BITS))
#define | VM_FRAME_TYPE(cfp) ((cfp)->flag & VM_FRAME_MAGIC_MASK)
#define | VM_FRAME_FLAG_PASSED 0x0100
#define | RUBYVM_CFUNC_FRAME_P(cfp) (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
#define | GET_VM_STATE_VERSION() (ruby_vm_global_state_version)
#define | INC_VM_STATE_VERSION() (ruby_vm_global_state_version = (ruby_vm_global_state_version+1) & 0x8fffffff)
#define | FUNC_FASTCALL(x) x
#define | GC_GUARDED_PTR(p) ((VALUE)((VALUE)(p) | 0x01))
#define | GC_GUARDED_PTR_REF(p) ((void *)(((VALUE)p) & ~0x03))
#define | GC_GUARDED_PTR_P(p) (((VALUE)p) & 0x01)
#define | RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) (cfp+1)
#define | RUBY_VM_NEXT_CONTROL_FRAME(cfp) (cfp-1)
#define | RUBY_VM_END_CONTROL_FRAME(th) ((rb_control_frame_t *)((th)->stack + (th)->stack_size))
#define | RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) ((void *)(ecfp) > (void *)(cfp))
#define | RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp) (!RUBY_VM_VALID_CONTROL_FRAME_P((cfp), RUBY_VM_END_CONTROL_FRAME(th)))
#define | RUBY_VM_IFUNC_P(ptr) (BUILTIN_TYPE(ptr) == T_NODE)
#define | RUBY_VM_NORMAL_ISEQ_P(ptr) (ptr && !RUBY_VM_IFUNC_P(ptr))
#define | RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp) ((rb_block_t *)(&(cfp)->self))
#define | RUBY_VM_GET_CFP_FROM_BLOCK_PTR(b) ((rb_control_frame_t *)((VALUE *)(b) - 5))
#define | SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)
#define | SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp))
#define | sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
#define | GET_VM() ruby_current_vm
#define | GET_THREAD() ruby_current_thread
#define | rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th))
#define | rb_thread_set_current(th)
#define | RUBY_VM_SET_INTERRUPT(th) ((th)->interrupt_flag |= 0x02)
#define | RUBY_VM_SET_TIMER_INTERRUPT(th) ((th)->interrupt_flag |= 0x01)
#define | RUBY_VM_SET_FINALIZER_INTERRUPT(th) ((th)->interrupt_flag |= 0x04)
#define | RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & 0x02)
#define | RUBY_VM_CHECK_INTS_TH(th)
#define | RUBY_VM_CHECK_INTS() RUBY_VM_CHECK_INTS_TH(GET_THREAD())
#define | EXEC_EVENT_HOOK(th, flag, self, id, klass)
## Typedefs
typedef unsigned long | rb_num_t
typedef struct rb_compile_option_struct | rb_compile_option_t
typedef struct rb_vm_struct | rb_vm_t
typedef struct rb_block_struct | rb_block_t
typedef RUBY_JMP_BUF | rb_jmpbuf_t
typedef struct rb_thread_struct | rb_thread_t
typedef struct iseq_inline_cache_entry * | IC
typedef VALUE | CDHASH
typedef rb_control_frame_t *FUNC_FASTCALL | rb_insn_func_t (rb_thread_t *, rb_control_frame_t *)
typedef int | rb_backtrace_iter_func (void *, VALUE, int, VALUE)
## Enumerations
enum | ruby_special_exceptions { ruby_error_reenter, ruby_error_nomemory, ruby_error_sysstack, ruby_special_error_count }
enum | rb_thread_status { THREAD_TO_KILL, THREAD_RUNNABLE, THREAD_STOPPED, THREAD_STOPPED_FOREVER, THREAD_KILLED }
## Functions
void | rb_objspace_free (struct rb_objspace *)
VALUE | rb_iseq_new (NODE *, VALUE, VALUE, VALUE, VALUE, VALUE)
VALUE | rb_iseq_new_top (NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE parent)
VALUE | rb_iseq_new_main (NODE *node, VALUE filename, VALUE filepath)
VALUE | rb_iseq_new_with_bopt (NODE *, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE)
VALUE | rb_iseq_new_with_opt (NODE *, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, const rb_compile_option_t *)
VALUE | rb_iseq_compile (VALUE src, VALUE file, VALUE line)
VALUE | rb_iseq_disasm (VALUE self)
int | rb_iseq_disasm_insn (VALUE str, VALUE *iseqval, size_t pos, rb_iseq_t *iseq, VALUE child)
| Disassemble a instruction Iseq -> Iseq inspect object.
const char * | ruby_node_name (int node)
int | rb_iseq_first_lineno (rb_iseq_t *iseq)
void | rb_vm_change_state (void)
VALUE | rb_thread_alloc (VALUE klass)
VALUE | rb_proc_alloc (VALUE klass)
void | rb_vmdebug_stack_dump_raw (rb_thread_t *, rb_control_frame_t *)
void | rb_vm_bugreport (void)
VALUE | rb_iseq_eval (VALUE iseqval)
VALUE | rb_iseq_eval_main (VALUE iseqval)
void | rb_enable_interrupt (void)
void | rb_disable_interrupt (void)
int | rb_thread_method_id_and_class (rb_thread_t *th, ID *idp, VALUE *klassp)
VALUE | rb_vm_invoke_proc (rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, const rb_block_t *blockptr)
VALUE | rb_vm_make_proc (rb_thread_t *th, const rb_block_t *block, VALUE klass)
VALUE | rb_vm_make_env_object (rb_thread_t *th, rb_control_frame_t *cfp)
void | rb_thread_start_timer_thread (void)
void | rb_thread_stop_timer_thread (void)
void | rb_thread_reset_timer_thread (void)
void * | rb_thread_call_with_gvl (void *(*func)(void *), void *data1)
int | ruby_thread_has_gvl_p (void)
VALUE | rb_make_backtrace (void)
int | rb_backtrace_each (rb_backtrace_iter_func *iter, void *arg)
rb_control_frame_t * | rb_vm_get_ruby_level_next_cfp (rb_thread_t *th, rb_control_frame_t *cfp)
int | rb_vm_get_sourceline (const rb_control_frame_t *)
VALUE | rb_name_err_mesg_new (VALUE obj, VALUE mesg, VALUE recv, VALUE method)
| NOINLINE (void rb_gc_save_machine_context(rb_thread_t *))
VALUE | rb_str_resurrect (VALUE str)
VALUE | rb_ary_resurrect (VALUE ary)
void | rb_threadptr_check_signal (rb_thread_t *mth)
void | rb_threadptr_signal_raise (rb_thread_t *th, int sig)
void | rb_threadptr_signal_exit (rb_thread_t *th)
void | rb_threadptr_execute_interrupts (rb_thread_t *)
void | rb_thread_lock_unlock (rb_thread_lock_t *)
void | rb_thread_lock_destroy (rb_thread_lock_t *)
void | rb_threadptr_exec_event_hooks (rb_thread_t *th, rb_event_flag_t flag, VALUE self, ID id, VALUE klass)
## Variables
RUBY_EXTERN VALUE | rb_cISeq
RUBY_EXTERN VALUE | rb_cRubyVM
RUBY_EXTERN VALUE | rb_cEnv
RUBY_EXTERN VALUE | rb_mRubyVMFrozenCore
VALUE | ruby_vm_global_state_version
RUBY_EXTERN rb_thread_t * | ruby_current_thread
rb_vm_t * | ruby_current_vm

## Define Documentation

#define ENABLE_VM_OBJSPACE 1

Definition at line 45 of file vm_core.h.

#define EXEC_EVENT_HOOK | ( |  | th,
|  |  | flag,
|  |  | self,
|  |  | id,
|  |  | klass
| ) |  |

Value:

    do { \
        rb_event_flag_t wait_event__ = th->event_flags; \
        if (UNLIKELY(wait_event__)) { \
            if (wait_event__ & (flag | RUBY_EVENT_VM)) { \
                rb_threadptr_exec_event_hooks(th, flag, self, id, klass); \
            } \
        } \
    } while (0)

Definition at line 698 of file vm_core.h.

Referenced by rb_iterate(), rb_raise_jump(), rb_threadptr_execute_interrupts_rec(), setup_exception(), vm_call0(), vm_call_cfunc(), and vm_exec().

#define FUNC_FASTCALL | ( |  | x | ) | x

Definition at line 586 of file vm_core.h.

#define GC_GUARDED_PTR | ( |  | p | ) | ((VALUE)((VALUE)(p) | 0x01))

Definition at line 592 of file vm_core.h.

Referenced by invoke_block_from_c(), rb_vm_make_proc(), vm_make_env_each(), vm_push_frame(), vm_set_eval_stack(), vm_yield_with_cfunc(), and yield_under().

#define GC_GUARDED_PTR_P | ( |  | p | ) | (((VALUE)p) & 0x01)

Definition at line 594 of file vm_core.h.

#define GC_GUARDED_PTR_REF | ( |  | p | ) | ((void *)(((VALUE)p) & ~0x03))

Definition at line 593 of file vm_core.h.

Referenced by check_block(), proc_new(), rb_block_given_p(), rb_f_block_given_p(), rb_f_local_variables(), rb_iterate(), rb_vm_make_proc(), rb_vmdebug_stack_dump_raw(), vm_iter_break(), vm_make_env_each(), vm_throw(), and yield_under().

#define GET_THREAD | ( |  | ) | ruby_current_thread

Definition at line 661 of file vm_core.h.

Referenced by call_trace_proc(), check_funcall(), cont_capture(), cont_new(), cont_restore_1(), default_handler(), do_select(), err_append(), error_handle(), error_print(), eval_string_with_cref(), eval_under(), fiber_store(), fiber_switch(), fiber_t_alloc(), garbage_collect(), gc_sweep(), get_errinfo(), Init_signal(), Init_Thread(), Init_VM(), m_core_define_method(), m_core_define_singleton_method(), m_core_set_postexe(), method_missing(), parse_string(), prepare_iseq_build(), proc_call(), proc_new(), process_options(), rb_add_method(), rb_backtrace(), rb_backtrace_each(), rb_barrier_wait(), rb_binding_new(), rb_block_given_p(), rb_call0(), rb_call_super(), rb_catch_obj(), rb_check_deadlock(), rb_cont_call(), rb_current_realfilepath(), rb_dvar_defined(), rb_errinfo(), rb_eval_string_wrap(), rb_exit(), rb_f_abort(), rb_f_block_given_p(), rb_f_caller(), rb_f_local_variables(), rb_fiber_current(), rb_fiber_start(), rb_frame_callee(), rb_frame_caller(), rb_frame_method_id_and_class(), rb_frame_pop(), rb_frame_this_func(), rb_funcall_passing_block(), rb_gc_register_mark_object(), rb_iseq_compile_with_option(), rb_iseq_eval(), rb_iseq_eval_main(), rb_iseq_new_main(), rb_iter_break(), rb_iterate(), rb_last_status_clear(), rb_last_status_get(), rb_last_status_set(), rb_load_internal(), rb_local_defined(), rb_longjmp(), rb_make_backtrace(), rb_memerror(), rb_method_call(), rb_method_missing(), rb_mutex_lock(), rb_mutex_trylock(), rb_mutex_unlock(), rb_newobj(), rb_parse_in_eval(), rb_parse_in_main(), rb_proc_call(), rb_proc_call_with_block(), rb_protect(), rb_raise_jump(), rb_require_safe(), rb_rescue2(), rb_safe_level(), rb_set_end_proc(), rb_set_errinfo(), rb_set_safe_level(), rb_set_safe_level_force(), rb_sourcefile(), rb_sourceline(), rb_thread_alone(), rb_thread_atfork(), rb_thread_atfork_internal(), rb_thread_blocking_region(), rb_thread_blocking_region_begin(), rb_thread_blocking_region_end(), rb_thread_check_trap_pending(), rb_thread_current(), rb_thread_exit(), rb_thread_kill(), rb_thread_list(), rb_thread_local_aref(), rb_thread_local_aset(), rb_thread_main(), rb_thread_mark(), rb_thread_polling(), rb_thread_s_abort_exc(), rb_thread_s_abort_exc_set(), rb_thread_schedule_rec(), rb_thread_sleep_deadly(), rb_thread_sleep_forever(), rb_thread_terminate_all(), rb_thread_wait_for(), rb_throw_obj(), rb_vm_bugreport(), rb_vm_call_cfunc(), rb_vm_cbase(), rb_vm_cref(), rb_vm_make_jump_tag_but_local_jump(), rb_vmdebug_stack_dump_raw_current(), rb_yield_0(), require_libraries(), return_fiber(), ruby_cleanup(), ruby_exec_internal(), ruby_finalize_1(), ruby_options(), ruby_stack_length(), ruby_suppress_tracing(), ruby_thread_init(), safe_setter(), send_internal(), set_relation(), stack_check(), thgroup_list(), thread_create_core(), thread_join(), top_include(), update_coverage(), vm_svar_get(), vm_svar_set(), and yield_under().

#define GET_VM | ( |  | ) | ruby_current_vm

Definition at line 660 of file vm_core.h.

Referenced by get_loaded_features(), get_loading_table(), Init_load(), Init_top_self(), load_lock(), process_options(), push_include(), rb_add_event_hook(), rb_clear_trace_func(), rb_get_coverages(), rb_get_load_path(), rb_remove_event_hook(), rb_reset_coverages(), rb_ruby_debug_ptr(), rb_ruby_verbose_ptr(), rb_set_coverages(), rb_signal_exec(), rb_threadptr_execute_interrupts_rec(), rb_trap_exit(), rb_unlink_method_entry(), rb_vm_set_progname(), rb_vm_top_self(), ruby_cleanup(), ruby_init(), ruby_init_loadpath_safe(), set_threads_event_flags(), thread_create_core(), timer_thread_function(), and trap().

#define GET_VM_STATE_VERSION | ( |  | ) | (ruby_vm_global_state_version)

Definition at line 578 of file vm_core.h.

Referenced by vm_method_search().

#define GetBindingPtr | ( |  | obj,
|  |  | ptr
| ) |  | GetCoreDataFromValue(obj, rb_binding_t, ptr)

Definition at line 529 of file vm_core.h.

Referenced by binding_dup(), eval_string_with_cref(), proc_binding(), process_options(), rb_binding_new(), and vm_set_main_stack().

#define GetCoreDataFromValue | ( |  | obj,
|  |  | type,
|  |  | ptr
| ) |  |

Value:

    do { \
        ptr = (type*)DATA_PTR(obj); \
    } while (0)

Definition at line 148 of file vm_core.h.

#define GetEnvPtr | ( |  | obj,
|  |  | ptr
| ) |  | GetCoreDataFromValue(obj, rb_env_t, ptr)

Definition at line 518 of file vm_core.h.

Referenced by check_env_value(), collect_local_variables_in_env(), eval_string_with_cref(), process_options(), rb_vmdebug_env_dump_raw(), rb_vmdebug_proc_dump_raw(), vm_collect_local_variables_in_heap(), vm_make_env_each(), and vm_set_main_stack().

#define GetISeqPtr | ( |  | obj,
|  |  | ptr
| ) |  | GetCoreDataFromValue(obj, rb_iseq_t, ptr)

Definition at line 155 of file vm_core.h.

Referenced by clone_method(), eval_string_with_cref(), Init_VM(), iseq_check(), iseq_data_to_ary(), iseq_inspect(), iseq_load(), iseq_set_sequence(), m_core_set_postexe(), rb_iseq_build_for_ruby2cext(), rb_iseq_clone(), rb_iseq_compile_node(), rb_iseq_new_with_bopt_and_opt(), set_relation(), vm_define_method(), vm_exec(), vm_set_eval_stack(), vm_set_main_stack(), and vm_set_top_stack().

#define GetProcPtr | ( |  | obj,
|  |  | ptr
| ) |  | GetCoreDataFromValue(obj, rb_proc_t, ptr)

Definition at line 505 of file vm_core.h.

Referenced by block_proc_is_lambda(), caller_setup_args(), iseq_s_disasm(), make_curry_proc(), method_proc(), proc_binding(), proc_call(), proc_dup(), proc_eq(), proc_hash(), proc_new(), proc_to_s(), rb_fiber_start(), rb_mod_define_method(), rb_proc_arity(), rb_proc_call(), rb_proc_call_with_block(), rb_proc_get_iseq(), rb_proc_lambda_p(), rb_vm_make_proc(), thread_start_func_2(), trap_handler(), vm_call0(), vm_call_bmethod(), vm_call_method(), and vm_callee_setup_arg_complex().

#define GetThreadPtr | ( |  | obj,
|  |  | ptr
| ) |  | GetCoreDataFromValue(obj, rb_thread_t, ptr)

Definition at line 343 of file vm_core.h.

Referenced by check_deadlock_i(), clear_trace_func_i(), rb_thread_abort_exc(), rb_thread_abort_exc_set(), rb_thread_alive_p(), rb_thread_backtrace(), rb_thread_group(), rb_thread_inspect(), rb_thread_interrupted(), rb_thread_key_p(), rb_thread_keys(), rb_thread_kill(), rb_thread_local_aref(), rb_thread_local_aset(), rb_thread_priority(), rb_thread_priority_set(), rb_thread_safe_level(), rb_thread_status(), rb_thread_stop_p(), rb_thread_wakeup(), rb_vmdebug_stack_dump_th(), rb_vmdebug_thread_dump_regs(), rb_vmdebug_thread_dump_state(), ruby_thread_init(), set_threads_event_flags_i(), terminate_atfork_before_exec_i(), terminate_atfork_i(), terminate_i(), thgroup_add(), thgroup_list_i(), thread_add_trace_func_m(), thread_create_core(), thread_initialize(), thread_join_m(), thread_list_i(), thread_raise_m(), thread_s_new(), thread_set_trace_func_m(), thread_value(), and thval2thread_t().

#define GetVMPtr | ( |  | obj,
|  |  | ptr
| ) |  | GetCoreDataFromValue(obj, rb_vm_t, ptr)

Definition at line 265 of file vm_core.h.

#define INC_VM_STATE_VERSION | ( |  | ) | (ruby_vm_global_state_version = (ruby_vm_global_state_version+1) & 0x8fffffff)

Definition at line 579 of file vm_core.h.

Referenced by m_core_undef_method(), rb_vm_change_state(), and vm_define_method().

#define LIKELY | ( |  | x | ) | (x)

Definition at line 109 of file vm_core.h.

Referenced by vm_method_search(), and vm_setup_method().

#define NSIG (_SIGMAX + 1)

Definition at line 53 of file vm_core.h.

Referenced by esignal_init(), and trap_signm().

#define rb_thread_set_current | ( |  | th | ) |

Value:

    do { \
        rb_thread_set_current_raw(th); \
        th->vm->running_thread = th; \
    } while (0)

Definition at line 663 of file vm_core.h.

Referenced by blocking_region_end(), Init_VM(), rb_thread_schedule_rec(), and thread_start_func_2().

#define rb_thread_set_current_raw | ( |  | th | ) | (void)(ruby_current_thread = (th))

Definition at line 662 of file vm_core.h.

Referenced by Init_BareVM().

#define RUBY_NSIG NSIG

Definition at line 56 of file vm_core.h.

Referenced by rb_get_next_signal(), and rb_vm_mark().

#define RUBY_VM_CHECK_INTS | ( |  | ) | RUBY_VM_CHECK_INTS_TH(GET_THREAD())

Definition at line 691 of file vm_core.h.

Referenced by fiber_switch(), rb_mutex_lock(), rb_thread_blocking_region_end(), rb_thread_check_ints(), rb_thread_polling(), rb_waitpid(), ruby_cleanup(), set_unblock_function(), sleep_forever(), sleep_timeval(), vm_call0(), and vm_call_method().

#define RUBY_VM_CHECK_INTS_TH | ( |  | th | ) |

Value:

    do { \
      if (UNLIKELY(th->interrupt_flag)) { \
        rb_threadptr_execute_interrupts(th); \
      } \
    } while (0)

Definition at line 685 of file vm_core.h.

#define RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P | ( |  | th,
|  |  | cfp
| ) |  | (!RUBY_VM_VALID_CONTROL_FRAME_P((cfp), RUBY_VM_END_CONTROL_FRAME(th)))

Definition at line 602 of file vm_core.h.

Referenced by rb_vm_get_ruby_level_next_cfp(), vm_get_ruby_level_caller_cfp(), and vm_normal_frame().

#define RUBY_VM_END_CONTROL_FRAME | ( |  | th | ) | ((rb_control_frame_t *)((th)->stack + (th)->stack_size))

Definition at line 598 of file vm_core.h.

Referenced by errinfo_place().

#define RUBY_VM_GET_BLOCK_PTR_IN_CFP | ( |  | cfp | ) | ((rb_block_t *)(&(cfp)->self))

Definition at line 609 of file vm_core.h.

Referenced by caller_setup_args(), eval_string_with_cref(), m_core_set_postexe(), and rb_iterate().

#define RUBY_VM_GET_CFP_FROM_BLOCK_PTR | ( |  | b | ) | ((rb_control_frame_t *)((VALUE *)(b) - 5))

Definition at line 610 of file vm_core.h.

Referenced by rb_vm_make_proc().

#define RUBY_VM_IFUNC_P | ( |  | ptr | ) | (BUILTIN_TYPE(ptr) == T_NODE)

Definition at line 605 of file vm_core.h.

Referenced by control_frame_dump(), frame_func_id(), proc_mark(), and rb_thread_method_id_and_class().

#define RUBY_VM_INTERRUPTED | ( |  | th | ) | ((th)->interrupt_flag & 0x02)

Definition at line 675 of file vm_core.h.

Referenced by check_deadlock_i(), lock_func(), and rb_thread_interrupted().

#define RUBY_VM_NEXT_CONTROL_FRAME | ( |  | cfp | ) | (cfp-1)

Definition at line 597 of file vm_core.h.

Referenced by vm_backtrace_each().

#define RUBY_VM_NORMAL_ISEQ_P | ( |  | ptr | ) | (ptr && !RUBY_VM_IFUNC_P(ptr))

Definition at line 606 of file vm_core.h.

Referenced by errinfo_place(), iseq_s_disasm(), proc_binding(), proc_to_s(), rb_proc_get_iseq(), rb_thread_mark(), rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), rb_vmdebug_debug_print_register(), vm_get_ruby_level_caller_cfp(), vm_make_env_each(), and vm_pop_frame().

#define RUBY_VM_PREVIOUS_CONTROL_FRAME | ( |  | cfp | ) | (cfp+1)

Definition at line 596 of file vm_core.h.

Referenced by errinfo_place(), proc_new(), raise_method_missing(), rb_current_realfilepath(), rb_f_block_given_p(), rb_f_local_variables(), rb_frame_caller(), rb_frame_pop(), rb_iterate(), rb_raise_jump(), rb_thread_mark(), rb_vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(), rb_vm_stack_to_heap(), send_internal(), vm_exec(), vm_get_ruby_level_caller_cfp(), vm_normal_frame(), vm_pop_frame(), vm_search_superclass(), and vm_throw().

#define RUBY_VM_SET_FINALIZER_INTERRUPT | ( |  | th | ) | ((th)->interrupt_flag |= 0x04)

Definition at line 674 of file vm_core.h.

Referenced by gc_sweep().

#define RUBY_VM_SET_INTERRUPT | ( |  | th | ) | ((th)->interrupt_flag |= 0x02)

Definition at line 672 of file vm_core.h.

Referenced by rb_fiber_start(), and rb_threadptr_interrupt().

#define RUBY_VM_SET_TIMER_INTERRUPT | ( |  | th | ) | ((th)->interrupt_flag |= 0x01)

Definition at line 673 of file vm_core.h.

Referenced by timer_thread_function().

#define RUBY_VM_THREAD_MODEL 2

Definition at line 15 of file vm_core.h.

#define RUBY_VM_THREAD_STACK_SIZE (128 * 1024)

Definition at line 503 of file vm_core.h.

Referenced by th_init2().

#define RUBY_VM_VALID_CONTROL_FRAME_P | ( |  | cfp,
|  |  | ecfp
| ) |  | ((void *)(ecfp) > (void *)(cfp))

Definition at line 600 of file vm_core.h.

Referenced by errinfo_place().

#define RUBY_VM_VALUE_CACHE_SIZE 0x1000

Definition at line 367 of file vm_core.h.

#define RUBYVM_CFUNC_FRAME_P | ( |  | cfp | ) | (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)

Definition at line 570 of file vm_core.h.

Referenced by vm_backtrace_each().

#define SDR | ( |  | ) | rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)

Definition at line 619 of file vm_core.h.

Referenced by rb_vm_bugreport(), vm_make_env_each(), vm_pop_frame(), and vm_push_frame().

#define SDR2 | ( |  | cfp | ) | rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp))

Definition at line 620 of file vm_core.h.

Referenced by rb_vmdebug_debug_print_post().

#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]

Definition at line 649 of file vm_core.h.

Referenced by Init_Proc(), make_exception(), ruby_thread_stack_overflow(), setup_exception(), stack_check(), and vm_push_frame().

#define UNINITIALIZED_VAR | ( |  | x | ) | x

Definition at line 116 of file vm_core.h.

Referenced by do_select().

#define UNLIKELY | ( |  | x | ) | (x)

Definition at line 110 of file vm_core.h.

Referenced by iseq_set_sequence(), rb_iterate(), rb_method_call_status(), rb_thread_schedule_rec(), vm_exec(), vm_exec_core(), and vm_getivar().

#define USE_VALUE_CACHE 0

Definition at line 368 of file vm_core.h.

#define va_init_list | ( |  | a,
|  |  | b
| ) |  | va_start(a)

Definition at line 63 of file vm_core.h.

#define VM_CALL_ARGS_BLOCKARG_BIT (0x01 << 2)

Definition at line 540 of file vm_core.h.

Referenced by caller_setup_args(), iseq_compile_each(), and setup_args().

#define VM_CALL_ARGS_SPLAT_BIT (0x01 << 1)

Definition at line 539 of file vm_core.h.

Referenced by caller_setup_args(), iseq_compile_each(), and setup_args().

#define VM_CALL_FCALL_BIT (0x01 << 3)

Definition at line 541 of file vm_core.h.

Referenced by iseq_compile_each(), and vm_call_method().

#define VM_CALL_OPT_SEND_BIT (0x01 << 8)

Definition at line 546 of file vm_core.h.

Referenced by vm_call_method().

#define VM_CALL_SUPER_BIT (0x01 << 7)

Definition at line 545 of file vm_core.h.

Referenced by vm_call_method().

#define VM_CALL_TAILCALL_BIT (0x01 << 5)

Definition at line 543 of file vm_core.h.

Referenced by iseq_peephole_optimize(), and vm_setup_method().

#define VM_CALL_TAILRECURSION_BIT (0x01 << 6)

Definition at line 544 of file vm_core.h.

#define VM_CALL_VCALL_BIT (0x01 << 4)

Definition at line 542 of file vm_core.h.

Referenced by iseq_compile_each(), and vm_call_method().

#define VM_FRAME_FLAG_PASSED 0x0100

Definition at line 568 of file vm_core.h.

Referenced by vm_get_ruby_level_caller_cfp().

#define VM_FRAME_MAGIC_BLOCK 0x21

Definition at line 553 of file vm_core.h.

Referenced by control_frame_dump(), invoke_block_from_c(), vm_exec(), and vm_invoke_block().

#define VM_FRAME_MAGIC_CFUNC 0x61

Definition at line 557 of file vm_core.h.

Referenced by control_frame_dump(), rb_iterate(), vm_call0(), vm_call_cfunc(), and vm_exec().

#define VM_FRAME_MAGIC_CLASS 0x31

Definition at line 554 of file vm_core.h.

Referenced by control_frame_dump(), and vm_exec().

#define VM_FRAME_MAGIC_EVAL 0x91

Definition at line 560 of file vm_core.h.

Referenced by control_frame_dump(), and vm_set_eval_stack().

#define VM_FRAME_MAGIC_FINISH 0x51

Definition at line 556 of file vm_core.h.

Referenced by control_frame_dump(), rb_vm_make_env_object(), rb_vm_set_finish_env(), rb_vmdebug_debug_print_pre(), and vm_exec().

#define VM_FRAME_MAGIC_IFUNC 0x81

Definition at line 559 of file vm_core.h.

Referenced by control_frame_dump(), and vm_yield_with_cfunc().

#define VM_FRAME_MAGIC_LAMBDA 0xa1

Definition at line 561 of file vm_core.h.

Referenced by control_frame_dump(), invoke_block_from_c(), and vm_throw().

#define VM_FRAME_MAGIC_MASK (~(~0<<VM_FRAME_MAGIC_MASK_BITS))

Definition at line 563 of file vm_core.h.

#define VM_FRAME_MAGIC_MASK_BITS 8

Definition at line 562 of file vm_core.h.

#define VM_FRAME_MAGIC_METHOD 0x11

Definition at line 552 of file vm_core.h.

Referenced by control_frame_dump(), vm_exec(), and vm_setup_method().

#define VM_FRAME_MAGIC_PROC 0x71

Definition at line 558 of file vm_core.h.

Referenced by control_frame_dump().

#define VM_FRAME_MAGIC_TOP 0x41

Definition at line 555 of file vm_core.h.

Referenced by control_frame_dump(), rb_vm_call_cfunc(), th_init2(), and vm_set_top_stack().

#define VM_FRAME_TYPE | ( |  | cfp | ) | ((cfp)->flag & VM_FRAME_MAGIC_MASK)

Definition at line 565 of file vm_core.h.

Referenced by control_frame_dump(), rb_iterate(), rb_vm_make_env_object(), rb_vmdebug_debug_print_pre(), vm_exec(), and vm_throw().

#define VM_SPECIAL_OBJECT_CBASE 0x02

Definition at line 549 of file vm_core.h.

Referenced by iseq_compile_each().

#define VM_SPECIAL_OBJECT_CONST_BASE 0x03

Definition at line 550 of file vm_core.h.

Referenced by compile_cpath(), and iseq_compile_each().

#define VM_SPECIAL_OBJECT_VMCORE 0x01

Definition at line 548 of file vm_core.h.

Referenced by iseq_compile_each().

## Typedef Documentation

typedef VALUE CDHASH

Definition at line 583 of file vm_core.h.

typedef struct iseq_inline_cache_entry* IC

Definition at line 574 of file vm_core.h.

typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE)

Definition at line 641 of file vm_core.h.

typedef struct rb_block_struct rb_block_t

typedef struct rb_compile_option_struct rb_compile_option_t

typedef rb_control_frame_t* FUNC_FASTCALL rb_insn_func_t(rb_thread_t *, rb_control_frame_t *)

Definition at line 590 of file vm_core.h.

typedef RUBY_JMP_BUF rb_jmpbuf_t

Definition at line 354 of file vm_core.h.

typedef unsigned long rb_num_t

Definition at line 119 of file vm_core.h.

typedef struct rb_thread_struct rb_thread_t

typedef struct rb_vm_struct rb_vm_t

## Enumeration Type Documentation

enum rb_thread_status

Enumerator:

  THREAD_TO_KILL |
  THREAD_RUNNABLE |
  THREAD_STOPPED |
  THREAD_STOPPED_FOREVER |
  THREAD_KILLED |

Definition at line 346 of file vm_core.h.

enum ruby_special_exceptions

Enumerator:

  ruby_error_reenter |
  ruby_error_nomemory |
  ruby_error_sysstack |
  ruby_special_error_count |

Definition at line 258 of file vm_core.h.

## Function Documentation

NOINLINE | ( | void | rb_gc_save_machine_contextrb_thread_t * | ) |

VALUE rb_ary_resurrect | ( | VALUE | ary | ) |

Definition at line 1548 of file array.c.

References RARRAY_LEN, RARRAY_PTR, and rb_ary_new4().

Referenced by obj_resurrect().

int rb_backtrace_each | ( | rb_backtrace_iter_func * | iter,
|  | void * | arg
| ) |  |

Definition at line 1643 of file vm_eval.c.

References GET_THREAD, NULL, and vm_backtrace_each().

Referenced by rb_vm_bugreport().

void rb_disable_interrupt | ( | void |  | ) |

Definition at line 543 of file signal.c.

References NULL, and pthread_sigmask().

Referenced by rb_get_next_signal().

void rb_enable_interrupt | ( | void |  | ) |

Definition at line 555 of file signal.c.

References NULL, and pthread_sigmask().

Referenced by rb_get_next_signal().

VALUE rb_iseq_compile | ( | VALUE | src,
|  | VALUE | file,
|  | VALUE | line
| ) |  |

Definition at line 570 of file iseq.c.

References Qnil, and rb_iseq_compile_with_option().

Referenced by eval_string_with_cref().

VALUE rb_iseq_disasm | ( | VALUE | self | ) |

Definition at line 917 of file iseq.c.

References rb_iseq_struct::arg_block, rb_iseq_struct::arg_opt_table, rb_iseq_struct::arg_opts, rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_post_start, rb_iseq_struct::arg_rest, rb_iseq_struct::arg_simple, argc, rb_iseq_struct::argc, rb_iseq_struct::catch_table, rb_iseq_struct::catch_table_size, catch_type(), iseq_catch_table_entry::cont, iseq_catch_table_entry::end, iseq_catch_table_entry::iseq, rb_iseq_struct::iseq, iseq_check(), iseq_inspect(), rb_iseq_struct::iseq_size, rb_iseq_struct::local_size, rb_iseq_struct::local_table, rb_iseq_struct::local_table_size, name, RARRAY_LEN, rb_ary_entry(), rb_ary_new(), rb_id2name(), rb_iseq_disasm(), rb_iseq_disasm_insn(), rb_secure(), rb_str_cat2(), rb_str_catf(), rb_str_concat(), rb_str_new(), rb_str_resize(), RSTRING_LEN, RSTRING_PTR, rb_iseq_struct::self, size, snprintf, iseq_catch_table_entry::sp, iseq_catch_table_entry::start, and iseq_catch_table_entry::type.

Referenced by eval_string_with_cref(), Init_ISeq(), iseq_s_disasm(), iseq_setup(), process_options(), and rb_iseq_disasm().

int rb_iseq_disasm_insn | ( | VALUE | str,
|  | VALUE * | iseqval,
|  | size_t | pos,
|  | rb_iseq_t * | iseq,
|  | VALUE | child
| ) |  |

Disassemble a instruction Iseq -> Iseq inspect object.

Definition at line 835 of file iseq.c.

References find_line_no(), find_prev_line_no(), get_insn_info(), insn_operand_intern(), len, iseq_insn_info_entry::line_no, PRIdSIZE, rb_str_cat2(), rb_str_catf(), rb_str_concat(), rb_str_new(), RSTRING_LEN, RSTRING_PTR, and iseq_insn_info_entry::sp.

Referenced by rb_iseq_disasm(), and rb_vmdebug_debug_print_pre().

VALUE rb_iseq_eval | ( | VALUE | iseqval | ) |

Definition at line 1366 of file vm.c.

References GET_THREAD, vm_exec(), and vm_set_top_stack().

Referenced by iseq_eval(), prelude_eval(), and rb_load_internal().

VALUE rb_iseq_eval_main | ( | VALUE | iseqval | ) |

Definition at line 1380 of file vm.c.

References GET_THREAD, vm_exec(), and vm_set_main_stack().

Referenced by ruby_exec_internal().

int rb_iseq_first_lineno | ( | rb_iseq_t * | iseq | ) |

Definition at line 673 of file iseq.c.

References FIX2INT, and rb_iseq_struct::line_no.

Referenced by iseq_location(), proc_binding(), proc_to_s(), and rb_method_entry_make().

VALUE rb_iseq_new | ( | NODE * | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE |
| ) |  |

Definition at line 375 of file iseq.c.

References INT2FIX, and rb_iseq_new_with_opt().

Referenced by Init_VM(), and rb_vm_call_cfunc().

VALUE rb_iseq_new_main | ( | NODE * | node,
|  | VALUE | filename,
|  | VALUE | filepath
| ) |  |

Definition at line 390 of file iseq.c.

References rb_thread_struct::base_block, GET_THREAD, INT2FIX, rb_block_struct::iseq, ISEQ_TYPE_MAIN, rb_iseq_new_with_opt(), rb_str_new2(), and rb_iseq_struct::self.

Referenced by process_options().

VALUE rb_iseq_new_top | ( | NODE * | node,
|  | VALUE | name,
|  | VALUE | filename,
|  | VALUE | filepath,
|  | VALUE | parent
| ) |  |

Definition at line 383 of file iseq.c.

References INT2FIX, ISEQ_TYPE_TOP, and rb_iseq_new_with_opt().

Referenced by rb_load_internal().

VALUE rb_iseq_new_with_bopt | ( | NODE * | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE |
| ) |  |

Definition at line 426 of file iseq.c.

References rb_iseq_new_with_bopt_and_opt().

VALUE rb_iseq_new_with_opt | ( | NODE * | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | VALUE | ,
|  | const rb_compile_option_t * |
| ) |  |

Definition at line 416 of file iseq.c.

References Qfalse, and rb_iseq_new_with_bopt_and_opt().

Referenced by iseq_s_compile_file(), new_child_iseq(), rb_iseq_compile_with_option(), rb_iseq_new(), rb_iseq_new_main(), and rb_iseq_new_top().

VALUE rb_make_backtrace | ( | void |  | ) |

Definition at line 1618 of file vm_eval.c.

References GET_THREAD, and vm_backtrace().

Referenced by argument_error(), parser_set_encode(), and setup_exception().

VALUE rb_name_err_mesg_new | ( | VALUE | obj,
|  | VALUE | mesg,
|  | VALUE | recv,
|  | VALUE | method
| ) |  |

Definition at line 825 of file error.c.

References ALLOC_N, NAME_ERR_MESG_COUNT, rb_cNameErrorMesg, RB_GC_GUARD, result, and TypedData_Wrap_Struct.

Referenced by Init_Exception(), and raise_method_missing().

void rb_objspace_free | ( | struct rb_objspace * |  | ) |

Definition at line 385 of file gc.c.

References free, global_List, heaps, heaps_used, list, gc_list::next, rb_objspace::profile, rb_objspace_call_finalizer(), and rb_objspace::record.

Referenced by ruby_vm_destruct().

VALUE rb_proc_alloc | ( | VALUE | klass | ) |

Definition at line 80 of file proc.c.

References TypedData_Make_Struct.

Referenced by proc_dup(), and rb_vm_make_proc().

VALUE rb_str_resurrect | ( | VALUE | str | ) |

Definition at line 899 of file string.c.

References rb_cString, str_alloc(), and str_replace().

Referenced by obj_resurrect().

VALUE rb_thread_alloc | ( | VALUE | klass | ) |

Definition at line 1832 of file vm.c.

References ruby_thread_init(), and thread_alloc().

Referenced by rb_thread_create(), thread_s_new(), and thread_start().

void* rb_thread_call_with_gvl | ( | void *(*)(void *) | func,
|  | void * | data1
| ) |  |

Definition at line 1169 of file thread.c.

References rb_unblock_callback::arg, blocking_region_begin, rb_thread_struct::blocking_region_buffer, blocking_region_end(), rb_unblock_callback::func, if(), rb_bug(), and rb_thread_struct::unblock.

Referenced by garbage_collect_with_gvl(), negative_size_allocation_error(), and ruby_memerror().

void rb_thread_lock_destroy | ( | rb_thread_lock_t * |  | ) |

Definition at line 261 of file thread.c.

Referenced by ruby_vm_destruct().

void rb_thread_lock_unlock | ( | rb_thread_lock_t * |  | ) |

Definition at line 255 of file thread.c.

Referenced by ruby_vm_destruct().

int rb_thread_method_id_and_class | ( | rb_thread_t * | th,
|  | ID * | idp,
|  | VALUE * | klassp
| ) |  |

Definition at line 1394 of file vm.c.

References rb_thread_struct::cfp, CONST_ID, rb_method_entry_struct::def, rb_iseq_struct::defined_method_id, rb_control_frame_t::iseq, iseq_catch_table_entry::iseq, rb_iseq_struct::klass, rb_method_entry_struct::klass, rb_iseq_struct::local_iseq, rb_control_frame_t::me, rb_method_definition_struct::original_id, rb_iseq_struct::parent_iseq, and RUBY_VM_IFUNC_P.

Referenced by call_trace_proc(), and rb_frame_method_id_and_class().

void rb_thread_reset_timer_thread | ( | void |  | ) |

Definition at line 2709 of file thread.c.

void rb_thread_start_timer_thread | ( | void |  | ) |

Definition at line 2715 of file thread.c.

References system_working.

void rb_thread_stop_timer_thread | ( | void |  | ) |

Definition at line 2701 of file thread.c.

void rb_threadptr_check_signal | ( | rb_thread_t * | mth | ) |

Definition at line 2660 of file thread.c.

References rb_thread_struct::exec_signal, rb_get_next_signal(), rb_threadptr_interrupt(), rb_thread_struct::status, thread_debug, THREAD_KILLED, THREAD_RUNNABLE, and thread_status_name().

Referenced by ruby_cleanup(), and timer_thread_function().

void rb_threadptr_exec_event_hooks | ( | rb_thread_t * | th,
|  | rb_event_flag_t | flag,
|  | VALUE | self,
|  | ID | id,
|  | VALUE | klass
| ) |  |

Definition at line 3785 of file thread.c.

References rb_thread_struct::errinfo, rb_thread_struct::event_flags, rb_vm_struct::event_hooks, rb_thread_struct::event_hooks, exec_event_hooks(), NULL, rb_mRubyVMFrozenCore, RUBY_EVENT_VM, and rb_thread_struct::vm.

void rb_threadptr_execute_interrupts | ( | rb_thread_t * |  | ) |

Definition at line 1321 of file thread.c.

References rb_threadptr_execute_interrupts_rec().

void rb_threadptr_signal_exit | ( | rb_thread_t * | th | ) |

Definition at line 1372 of file thread.c.

References argv, rb_vm_struct::main_thread, rb_eSystemExit, rb_str_new2(), rb_threadptr_raise(), and rb_thread_struct::vm.

Referenced by rb_signal_exec().

void rb_threadptr_signal_raise | ( | rb_thread_t * | th,
|  | int | sig
| ) |  |

Definition at line 1362 of file thread.c.

References argv, INT2FIX, rb_vm_struct::main_thread, rb_eSignal, rb_threadptr_raise(), and rb_thread_struct::vm.

Referenced by rb_signal_exec().

void rb_vm_bugreport | ( | void |  | ) |

Definition at line 590 of file vm_dump.c.

References bugreport_backtrace(), free, GET_THREAD, rb_backtrace_each(), and SDR.

void rb_vm_change_state | ( | void |  | ) |

Definition at line 55 of file vm.c.

References INC_VM_STATE_VERSION.

rb_control_frame_t* rb_vm_get_ruby_level_next_cfp | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp
| ) |  |

Definition at line 142 of file vm.c.

References rb_control_frame_t::iseq, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_NORMAL_ISEQ_P, and RUBY_VM_PREVIOUS_CONTROL_FRAME.

Referenced by eval_string_with_cref(), m_core_set_postexe(), rb_add_method(), rb_binding_new(), rb_sourcefile(), rb_sourceline(), rb_vm_cbase(), rb_vm_cref(), and rb_vm_stack_to_heap().

int rb_vm_get_sourceline | ( | const rb_control_frame_t * |  | ) |

Definition at line 687 of file vm.c.

References rb_iseq_struct::insn_info_size, rb_iseq_struct::insn_info_table, rb_control_frame_t::iseq, rb_iseq_struct::iseq_encoded, iseq_insn_info_entry::line_no, rb_control_frame_t::pc, iseq_insn_info_entry::position, and RUBY_VM_NORMAL_ISEQ_P.

VALUE rb_vm_invoke_proc | ( | rb_thread_t * | th,
|  | rb_proc_t * | proc,
|  | VALUE | self,
|  | int | argc,
|  | const VALUE * | argv,
|  | const rb_block_t * | blockptr
| ) |  |

Definition at line 592 of file vm.c.

References rb_proc_t::block, EXEC_TAG, invoke_block_from_c(), rb_proc_t::is_from_method, JUMP_TAG, Qundef, rb_proc_t::safe_level, rb_thread_struct::safe_level, TH_POP_TAG, and TH_PUSH_TAG.

Referenced by proc_call(), rb_fiber_start(), rb_proc_call(), rb_proc_call_with_block(), thread_start_func_2(), vm_call0(), vm_call_bmethod(), and vm_call_method().

VALUE rb_vm_make_env_object | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp
| ) |  |

Definition at line 423 of file vm.c.

References check_env_value(), rb_control_frame_t::dfp, rb_control_frame_t::lfp, PROCDEBUG, RUBY_VM_PREVIOUS_CONTROL_FRAME, VM_FRAME_MAGIC_FINISH, VM_FRAME_TYPE, and vm_make_env_each().

Referenced by eval_string_with_cref(), rb_binding_new(), rb_vm_make_proc(), rb_vm_stack_to_heap(), and vm_set_main_stack().

VALUE rb_vm_make_proc | ( | rb_thread_t * | th,
|  | const rb_block_t * | block,
|  | VALUE | klass
| ) |  |

Definition at line 469 of file vm.c.

References rb_proc_t::block, rb_proc_t::blockprocval, check_env_value(), rb_block_struct::dfp, rb_proc_t::envval, GC_GUARDED_PTR, GC_GUARDED_PTR_REF, GetProcPtr, rb_block_struct::iseq, rb_block_struct::lfp, rb_control_frame_t::lfp, rb_block_struct::proc, PROCDEBUG, rb_bug(), rb_proc_alloc(), rb_vm_make_env_object(), RUBY_VM_GET_CFP_FROM_BLOCK_PTR, rb_thread_struct::safe_level, rb_proc_t::safe_level, rb_block_struct::self, rb_thread_struct::stack, rb_thread_struct::stack_size, vm_make_proc_from_block(), and VMDEBUG.

Referenced by m_core_set_postexe(), proc_new(), vm_callee_setup_arg_complex(), vm_make_proc_from_block(), vm_yield_setup_block_args(), and vm_yield_with_cfunc().

void rb_vmdebug_stack_dump_raw | ( | rb_thread_t * | ,
|  | rb_control_frame_t * |
| ) |  |

Definition at line 145 of file vm_dump.c.

References rb_control_frame_t::bp, bp, control_frame_dump(), rb_control_frame_t::dfp, GC_GUARDED_PTR_REF, rb_control_frame_t::lfp, PRIxVALUE, rb_control_frame_t::sp, rb_thread_struct::stack, and rb_thread_struct::stack_size.

Referenced by rb_vmdebug_stack_dump_raw_current(), and rb_vmdebug_stack_dump_th().

const char* ruby_node_name | ( | int | node | ) |

Definition at line 1045 of file iseq.c.

References rb_bug().

Referenced by compile_array_(), iseq_compile_each(), iseq_set_arguments(), ruby_debug_print_node(), and setup_args().

int ruby_thread_has_gvl_p | ( | void |  | ) |

Definition at line 1211 of file thread.c.

References rb_thread_struct::blocking_region_buffer.

Referenced by garbage_collect_with_gvl(), negative_size_allocation_error(), and ruby_memerror().

## Variable Documentation

RUBY_EXTERN VALUE rb_cEnv

Definition at line 499 of file vm_core.h.

RUBY_EXTERN VALUE rb_cISeq

Definition at line 497 of file vm_core.h.

RUBY_EXTERN VALUE rb_cRubyVM

Definition at line 498 of file vm_core.h.

RUBY_EXTERN VALUE rb_mRubyVMFrozenCore

Definition at line 500 of file vm_core.h.

RUBY_EXTERN rb_thread_t* ruby_current_thread

Definition at line 657 of file vm_core.h.

rb_vm_t* ruby_current_vm

Definition at line 44 of file vm.c.

Referenced by Init_VM().

VALUE ruby_vm_global_state_version

Definition at line 38 of file vm.c.