vm_core.h File Reference

#include "ruby/ruby.h"
#include "ruby/st.h"
#include "node.h"
#include "vm_debug.h"
#include "vm_opts.h"
#include "id.h"
#include "method.h"
#include "ruby_atomic.h"
#include "thread_native.h"
#include <setjmp.h>
#include <signal.h>
#include <varargs.h>

Go to the source code of this file.

Data Structures

struct  iseq_inline_cache_entry
union  iseq_inline_storage_entry
struct  rb_call_info_struct
struct  rb_iseq_location_struct
struct  rb_iseq_struct
struct  rb_hook_list_struct
struct  rb_vm_struct
struct  rb_control_frame_struct
struct  rb_block_struct
struct  rb_vm_tag
struct  rb_vm_protect_tag
struct  rb_unblock_callback
struct  rb_thread_list_struct
struct  rb_ensure_entry
struct  rb_ensure_list
struct  rb_thread_struct
struct  rb_proc_t
struct  rb_env_t
struct  rb_binding_t
struct  rb_trace_arg_struct

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 __has_attribute(x)   0
#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 RUBY_VM_SIZE_ALIGN   4096
#define RUBY_VM_THREAD_VM_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE))
#define RUBY_VM_THREAD_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE))
#define RUBY_VM_THREAD_MACHINE_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE))
#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE))
#define RUBY_VM_FIBER_VM_STACK_SIZE   ( 16 * 1024 * sizeof(VALUE))
#define RUBY_VM_FIBER_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE))
#define RUBY_VM_FIBER_MACHINE_STACK_SIZE   ( 64 * 1024 * sizeof(VALUE))
#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE))
#define VM_DEBUG_BP_CHECK   0
#define GetThreadPtr(obj, ptr)   TypedData_Get_Struct((obj), rb_thread_t, &ruby_threadptr_data_type, (ptr))
#define VM_DEFINECLASS_TYPE(x)   ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK)
#define VM_DEFINECLASS_FLAG_SCOPED   0x08
#define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS   0x10
#define VM_DEFINECLASS_SCOPED_P(x)   ((x) & VM_DEFINECLASS_FLAG_SCOPED)
#define VM_DEFINECLASS_HAS_SUPERCLASS_P(x)   ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS)
#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_CHECKMATCH_TYPE_MASK   0x03
#define VM_CHECKMATCH_ARRAY   0x04
#define VM_CALL_ARGS_SPLAT   (0x01 << 1)
#define VM_CALL_ARGS_BLOCKARG   (0x01 << 2)
#define VM_CALL_FCALL   (0x01 << 3)
#define VM_CALL_VCALL   (0x01 << 4)
#define VM_CALL_TAILCALL   (0x01 << 5)
#define VM_CALL_SUPER   (0x01 << 6)
#define VM_CALL_OPT_SEND   (0x01 << 7)
#define VM_CALL_ARGS_SKIP_SETUP   (0x01 << 8)
#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_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_RESCUE   0xb1
#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 VM_FRAME_FLAG_FINISH   0x0200
#define VM_FRAME_FLAG_BMETHOD   0x0400
#define VM_FRAME_TYPE_FINISH_P(cfp)   (((cfp)->flag & VM_FRAME_FLAG_FINISH) != 0)
#define VM_FRAME_TYPE_BMETHOD_P(cfp)   (((cfp)->flag & VM_FRAME_FLAG_BMETHOD) != 0)
#define RUBYVM_CFUNC_FRAME_P(cfp)   (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
#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 VM_ENVVAL_BLOCK_PTR_FLAG   0x02
#define VM_ENVVAL_BLOCK_PTR(v)   (GC_GUARDED_PTR(v) | VM_ENVVAL_BLOCK_PTR_FLAG)
#define VM_ENVVAL_BLOCK_PTR_P(v)   ((v) & VM_ENVVAL_BLOCK_PTR_FLAG)
#define VM_ENVVAL_PREV_EP_PTR(v)   ((VALUE)GC_GUARDED_PTR(v))
#define VM_ENVVAL_PREV_EP_PTR_P(v)   (!(VM_ENVVAL_BLOCK_PTR_P(v)))
#define VM_EP_PREV_EP(ep)   ((VALUE *)GC_GUARDED_PTR_REF((ep)[0]))
#define VM_EP_BLOCK_PTR(ep)   ((rb_block_t *)GC_GUARDED_PTR_REF((ep)[0]))
#define VM_EP_LEP_P(ep)   VM_ENVVAL_BLOCK_PTR_P((ep)[0])
#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) - 4))
#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 RUBY_CONST_ASSERT(expr)   (1/!!(expr))
#define VM_STACK_OVERFLOWED_P(cfp, sp, margin)
#define WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin)   if (LIKELY(!VM_STACK_OVERFLOWED_P(cfp, sp, margin))) {(void)0;} else
#define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin)   WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) vm_stackoverflow()
#define CHECK_VM_STACK_OVERFLOW(cfp, margin)   WHEN_VM_STACK_OVERFLOWED(cfp, (cfp)->sp, margin) vm_stackoverflow()
#define GET_VM()   ruby_current_vm
#define OPT_CALL_CFUNC_WITHOUT_FRAME   0
#define rb_thread_set_current_raw(th)   (void)(ruby_current_thread = (th))
#define rb_thread_set_current(th)
#define RUBY_VM_SET_TIMER_INTERRUPT(th)   ATOMIC_OR((th)->interrupt_flag, TIMER_INTERRUPT_MASK)
#define RUBY_VM_SET_INTERRUPT(th)   ATOMIC_OR((th)->interrupt_flag, PENDING_INTERRUPT_MASK)
#define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th)   ATOMIC_OR((th)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK)
#define RUBY_VM_SET_TRAP_INTERRUPT(th)   ATOMIC_OR((th)->interrupt_flag, TRAP_INTERRUPT_MASK)
#define RUBY_VM_INTERRUPTED(th)   ((th)->interrupt_flag & ~(th)->interrupt_mask & (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))
#define RUBY_VM_INTERRUPTED_ANY(th)   ((th)->interrupt_flag & ~(th)->interrupt_mask)
#define RUBY_VM_CHECK_INTS_BLOCKING(th)
#define RUBY_VM_CHECK_INTS(th)
#define EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, pop_p_)
#define EXEC_EVENT_HOOK(th_, flag_, self_, id_, klass_, data_)   EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 0)
#define EXEC_EVENT_HOOK_AND_POP_FRAME(th_, flag_, self_, id_, klass_, data_)   EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 1)

Typedefs

typedef unsigned long rb_num_t
typedef rb_compile_option_struct rb_compile_option_t
typedef rb_call_info_struct rb_call_info_t
typedef rb_iseq_location_struct rb_iseq_location_t
typedef rb_hook_list_struct rb_hook_list_t
typedef rb_vm_struct rb_vm_t
typedef rb_control_frame_struct rb_control_frame_t
typedef rb_block_struct rb_block_t
typedef RUBY_JMP_BUF rb_jmpbuf_t
typedef rb_thread_list_struct rb_thread_list_t
typedef rb_ensure_entry rb_ensure_entry_t
typedef rb_ensure_list rb_ensure_list_t
typedef rb_thread_struct rb_thread_t
typedef iseq_inline_cache_entryIC
typedef rb_call_info_tCALL_INFO
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_error_closed_stream,
  ruby_special_error_count
}
enum  rb_thread_status { THREAD_RUNNABLE, THREAD_STOPPED, THREAD_STOPPED_FOREVER, THREAD_KILLED }
enum  rb_vm_defineclass_type_t { VM_DEFINECLASS_TYPE_CLASS = 0x00, VM_DEFINECLASS_TYPE_SINGLETON_CLASS = 0x01, VM_DEFINECLASS_TYPE_MODULE = 0x02, VM_DEFINECLASS_TYPE_MASK = 0x07 }
enum  vm_check_match_type { VM_CHECKMATCH_TYPE_WHEN = 1, VM_CHECKMATCH_TYPE_CASE = 2, VM_CHECKMATCH_TYPE_RESCUE = 3 }
enum  vm_special_object_type { VM_SPECIAL_OBJECT_VMCORE = 1, VM_SPECIAL_OBJECT_CBASE, VM_SPECIAL_OBJECT_CONST_BASE }
enum  { TIMER_INTERRUPT_MASK = 0x01, PENDING_INTERRUPT_MASK = 0x02, POSTPONED_JOB_INTERRUPT_MASK = 0x04, TRAP_INTERRUPT_MASK = 0x08 }

Functions

void rb_objspace_free (struct rb_objspace *)
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_new (NODE *, VALUE, VALUE, VALUE, VALUE, enum iseq_type)
VALUE rb_iseq_new_top (NODE *node, VALUE name, VALUE path, VALUE absolute_path, VALUE parent)
VALUE rb_iseq_new_main (NODE *node, VALUE path, VALUE absolute_path)
VALUE rb_iseq_new_with_bopt (NODE *, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, VALUE)
VALUE rb_iseq_new_with_opt (NODE *, VALUE, VALUE, VALUE, VALUE, VALUE, enum iseq_type, const rb_compile_option_t *)
VALUE rb_iseq_compile (VALUE src, VALUE file, VALUE line)
VALUE rb_iseq_compile_on_base (VALUE src, VALUE file, VALUE line, rb_block_t *base_block)
VALUE rb_iseq_compile_with_option (VALUE src, VALUE file, VALUE absolute_path, VALUE line, rb_block_t *base_block, VALUE opt)
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)
void rb_vm_change_state (void)
VALUE * rb_vm_ep_local_ep (VALUE *ep)
rb_block_trb_vm_control_frame_block_ptr (rb_control_frame_t *cfp)
VALUE rb_thread_alloc (VALUE klass)
VALUE rb_proc_alloc (VALUE klass)
VALUE rb_binding_alloc (VALUE klass)
void rb_vmdebug_stack_dump_raw (rb_thread_t *, rb_control_frame_t *)
void rb_vmdebug_debug_print_pre (rb_thread_t *th, rb_control_frame_t *cfp, VALUE *_pc)
void rb_vmdebug_debug_print_post (rb_thread_t *th, rb_control_frame_t *cfp)
void rb_vm_bugreport (void)
RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_eval (VALUE iseqval)
VALUE rb_iseq_eval_main (VALUE iseqval)
RUBY_SYMBOL_EXPORT_END 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, 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_binding (rb_thread_t *th, const rb_control_frame_t *src_cfp)
VALUE rb_vm_make_env_object (rb_thread_t *th, rb_control_frame_t *cfp)
VALUE rb_binding_new_with_cfp (rb_thread_t *th, const rb_control_frame_t *src_cfp)
VALUE * rb_binding_add_dynavars (rb_binding_t *bind, int dyncount, const ID *dynvars)
void rb_vm_inc_const_missing_count (void)
void rb_vm_gvl_destroy (rb_vm_t *vm)
VALUE rb_vm_call (rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_method_entry_t *me, VALUE defined_class)
void rb_unlink_method_entry (rb_method_entry_t *me)
void rb_gc_mark_unlinked_live_method_entries (void *pvm)
void rb_thread_start_timer_thread (void)
void rb_thread_stop_timer_thread (int)
void rb_thread_reset_timer_thread (void)
void rb_thread_wakeup_timer_thread (void)
int ruby_thread_has_gvl_p (void)
rb_control_frame_trb_vm_get_ruby_level_next_cfp (rb_thread_t *th, const rb_control_frame_t *cfp)
rb_control_frame_trb_vm_get_binding_creatable_next_cfp (rb_thread_t *th, const 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)
void rb_vm_stack_to_heap (rb_thread_t *th)
void ruby_thread_init_stack (rb_thread_t *th)
int rb_vm_control_frame_id_and_class (const rb_control_frame_t *cfp, ID *idp, VALUE *klassp)
void rb_vm_rewind_cfp (rb_thread_t *th, rb_control_frame_t *cfp)
void rb_gc_mark_machine_stack (rb_thread_t *th)
int rb_autoloading_value (VALUE mod, ID id, VALUE *value)
static rb_thread_tGET_THREAD (void)
int rb_signal_buff_size (void)
void rb_signal_exec (rb_thread_t *th, int sig)
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 *, int)
void rb_threadptr_interrupt (rb_thread_t *th)
void rb_threadptr_unlock_all_locking_mutexes (rb_thread_t *th)
void rb_threadptr_pending_interrupt_clear (rb_thread_t *th)
void rb_threadptr_pending_interrupt_enque (rb_thread_t *th, VALUE v)
int rb_threadptr_pending_interrupt_active_p (rb_thread_t *th)
void rb_threadptr_exec_event_hooks (struct rb_trace_arg_struct *trace_arg)
void rb_threadptr_exec_event_hooks_and_pop_frame (struct rb_trace_arg_struct *trace_arg)
VALUE rb_threadptr_reset_recursive_data (rb_thread_t *th)
void rb_threadptr_restore_recursive_data (rb_thread_t *th, VALUE old)
RUBY_SYMBOL_EXPORT_BEGIN int rb_thread_check_trap_pending (void)
VALUE rb_get_coverages (void)
void rb_set_coverages (VALUE)
void rb_reset_coverages (void)
void rb_postponed_job_flush (rb_vm_t *vm)

Variables

const rb_data_type_t ruby_threadptr_data_type
RUBY_EXTERN VALUE rb_cISeq
RUBY_EXTERN VALUE rb_cRubyVM
RUBY_EXTERN VALUE rb_cEnv
RUBY_EXTERN VALUE rb_mRubyVMFrozenCore
const rb_data_type_t ruby_binding_data_type
rb_thread_truby_current_thread
rb_vm_truby_current_vm
rb_event_flag_t ruby_vm_event_flags


Define Documentation

#define __has_attribute (  )     0

Definition at line 113 of file vm_core.h.

#define CHECK_VM_STACK_OVERFLOW ( cfp,
margin   )     WHEN_VM_STACK_OVERFLOWED(cfp, (cfp)->sp, margin) vm_stackoverflow()

Definition at line 910 of file vm_core.h.

Referenced by vm_call0_body(), vm_call_method_missing(), vm_caller_setup_args(), and vm_yield_setup_block_args().

#define CHECK_VM_STACK_OVERFLOW0 ( cfp,
sp,
margin   )     WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) vm_stackoverflow()

Definition at line 908 of file vm_core.h.

Referenced by vm_push_frame().

#define ENABLE_VM_OBJSPACE   1

Definition at line 40 of file vm_core.h.

#define EXEC_EVENT_HOOK ( th_,
flag_,
self_,
id_,
klass_,
data_   )     EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 0)

Definition at line 1034 of file vm_core.h.

Referenced by gc_event_hook_body(), invoke_block_from_c(), rb_raise_jump(), rb_threadptr_execute_interrupts(), rb_vm_pop_cfunc_frame(), setup_exception(), thread_start_func_2(), vm_call0_cfunc_with_frame(), vm_call_cfunc_with_frame(), and vm_exec().

#define EXEC_EVENT_HOOK_AND_POP_FRAME ( th_,
flag_,
self_,
id_,
klass_,
data_   )     EXEC_EVENT_HOOK_ORIG(th_, flag_, self_, id_, klass_, data_, 1)

Definition at line 1037 of file vm_core.h.

Referenced by vm_exec().

#define EXEC_EVENT_HOOK_ORIG ( th_,
flag_,
self_,
id_,
klass_,
data_,
pop_p_   ) 

Value:

do { \
    if (UNLIKELY(ruby_vm_event_flags & (flag_))) { \
        if (((th)->event_hooks.events | (th)->vm->event_hooks.events) & (flag_)) { \
            struct rb_trace_arg_struct trace_arg; \
            trace_arg.event = (flag_); \
            trace_arg.th = (th_); \
            trace_arg.cfp = (trace_arg.th)->cfp; \
            trace_arg.self = (self_); \
            trace_arg.id = (id_); \
            trace_arg.klass = (klass_); \
            trace_arg.data = (data_); \
            trace_arg.path = Qundef; \
            trace_arg.klass_solved = 0; \
            if (pop_p_) rb_threadptr_exec_event_hooks_and_pop_frame(&trace_arg); \
            else rb_threadptr_exec_event_hooks(&trace_arg); \
        } \
    } \
} while (0)

Definition at line 1015 of file vm_core.h.

#define FUNC_FASTCALL (  )     x

Definition at line 793 of file vm_core.h.

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

Definition at line 799 of file vm_core.h.

Referenced by collect_caller_bindings_cfunc(), and collect_caller_bindings_iseq().

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

Definition at line 801 of file vm_core.h.

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

Definition at line 800 of file vm_core.h.

Referenced by collect_caller_bindings(), rb_vmdebug_stack_dump_raw(), vm_make_env_each(), and vm_throw().

 
#define GET_VM (  )     ruby_current_vm

Definition at line 920 of file vm_core.h.

Referenced by bm_free(), gc_before_sweep(), get_loaded_features(), get_loaded_features_index(), get_loaded_features_index_raw(), get_loading_table(), Init_load(), Init_postponed_job(), Init_top_self(), load_lock(), lookup_rollback_func(), process_options(), push_include(), rb_add_event_hook(), rb_add_event_hook2(), rb_clear_trace_func(), rb_construct_expanded_load_path(), rb_f_kill(), rb_get_coverages(), rb_get_expanded_load_path(), rb_get_load_path(), rb_iseq_defined_string(), rb_remove_event_hook(), rb_remove_event_hook_with_data(), rb_reset_coverages(), rb_ruby_debug_ptr(), rb_ruby_verbose_ptr(), rb_set_coverages(), rb_signal_exec(), rb_trap_exit(), rb_unlink_method_entry(), rb_vm_add_root_module(), rb_vm_bugreport(), rb_vm_set_progname(), rb_vm_top_self(), reset_loaded_features_snapshot(), ruby_cleanup(), ruby_init_ext(), ruby_init_loadpath_safe(), ruby_register_rollback_func_for_ensure(), ruby_setup(), ruby_vm_at_exit(), thread_join(), thread_s_new(), timer_thread_function(), trap(), and vm_default_params().

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

Definition at line 723 of file vm_core.h.

Referenced by bind_local_variable_defined_p(), bind_local_variable_get(), bind_local_variable_set(), binding_dup(), proc_binding(), rb_vm_make_binding(), toplevel_context(), and vm_set_main_stack().

#define GetCoreDataFromValue ( obj,
type,
ptr   ) 

Value:

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

Definition at line 186 of file vm_core.h.

Referenced by backtrace_load_data(), backtrace_to_location_ary(), backtrace_to_str_ary(), bt_init(), location_ptr(), rb_backtrace_to_location_ary(), rb_backtrace_to_str_ary(), and vm_backtrace_to_ary().

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

Definition at line 710 of file vm_core.h.

Referenced by check_env_value(), collect_local_variables_in_env(), eval_string_with_cref(), get_local_variable_ptr(), rb_binding_add_dynavars(), rb_vmdebug_env_dump_raw(), rb_vmdebug_proc_dump_raw(), toplevel_context(), vm_collect_local_variables_in_heap(), vm_make_env_each(), vm_rewrite_ep_in_errinfo(), and vm_set_main_stack().

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

Definition at line 193 of file vm_core.h.

Referenced by clone_method(), eval_string_with_cref(), Init_VM(), iseq_check(), iseq_inspect(), iseq_load(), iseq_set_sequence(), new_callinfo(), rb_iseq_absolute_path(), rb_iseq_base_label(), rb_iseq_build_for_ruby2cext(), rb_iseq_clone(), rb_iseq_compile_node(), rb_iseq_first_lineno(), rb_iseq_klass(), rb_iseq_label(), rb_iseq_line_trace_each(), rb_iseq_method_name(), rb_iseq_new_with_bopt_and_opt(), rb_iseq_path(), set_relation(), vm_define_method(), 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 697 of file vm_core.h.

Referenced by block_proc_is_lambda(), iseq_s_of(), make_curry_proc(), method_proc(), proc_binding(), proc_call(), proc_dup(), proc_new(), proc_to_s(), rb_block_arity(), rb_fiber_start(), rb_funcall_with_block(), rb_hash_proc(), rb_method_call_with_block(), rb_mod_define_method(), rb_proc_arity(), rb_proc_call(), rb_proc_call_with_block(), rb_proc_get_iseq(), rb_proc_lambda_p(), rb_proc_min_max_arity(), rb_vm_make_proc(), rb_yield_block(), thread_start_func_2(), trap_handler(), vm_call0_body(), vm_call_bmethod_body(), vm_call_opt_call(), vm_caller_setup_args(), and vm_make_env_object().

#define GetThreadPtr ( obj,
ptr   )     TypedData_Get_Struct((obj), rb_thread_t, &ruby_threadptr_data_type, (ptr))

Definition at line 472 of file vm_core.h.

Referenced by check_deadlock_i(), clear_trace_func_i(), cont_mark(), rb_fiber_reset_root_local_storage(), rb_thread_abort_exc(), rb_thread_abort_exc_set(), rb_thread_alive_p(), rb_thread_execute_interrupts(), 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_pending_interrupt_p(), rb_thread_priority(), rb_thread_priority_set(), rb_thread_safe_level(), rb_thread_status(), rb_thread_stop_p(), rb_thread_wakeup_alive(), rb_tracepoint_new(), rb_vmdebug_stack_dump_th(), rb_vmdebug_thread_dump_regs(), rb_vmdebug_thread_dump_state(), ruby_thread_init(), terminate_atfork_before_exec_i(), terminate_atfork_i(), terminate_i(), thgroup_add(), thgroup_list_i(), thread_add_trace_func_m(), thread_backtrace_to_ary(), thread_create_core(), thread_fd_close_i(), 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 334 of file vm_core.h.

#define LIKELY (  )     (x)

Definition at line 108 of file vm_core.h.

Referenced by gc_mark(), gc_mark_children(), mark_m_tbl_wrapper(), vm_call_iseq_setup_2(), vm_callee_setup_arg(), vm_getivar(), vm_search_method(), and vm_setivar().

#define NSIG   (_SIGMAX + 1)

Definition at line 48 of file vm_core.h.

Referenced by esignal_init(), and trap_signm().

#define OPT_CALL_CFUNC_WITHOUT_FRAME   0

Definition at line 923 of file vm_core.h.

#define rb_thread_set_current ( th   ) 

Value:

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

Definition at line 940 of file vm_core.h.

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

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

Definition at line 939 of file vm_core.h.

Referenced by Init_BareVM().

#define RUBY_CONST_ASSERT ( expr   )     (1/!!(expr))

Definition at line 901 of file vm_core.h.

#define RUBY_NSIG   NSIG

Definition at line 51 of file vm_core.h.

Referenced by rb_get_next_signal(), and rb_vm_mark().

#define RUBY_VM_CHECK_INTS ( th   ) 

Value:

do { \
    if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) {        \
        rb_threadptr_execute_interrupts(th, 0); \
    } \
} while (0)

Definition at line 989 of file vm_core.h.

Referenced by fiber_switch(), rb_thread_s_handle_interrupt(), rb_waitpid(), ruby_cleanup(), set_unblock_function(), thread_raise_m(), vm_call0_body(), and vm_call_iseq_setup_tailcall().

#define RUBY_VM_CHECK_INTS_BLOCKING ( th   ) 

Value:

Definition at line 978 of file vm_core.h.

Referenced by call_without_gvl(), do_select(), rb_mutex_lock(), rb_thread_blocking_region_end(), rb_thread_check_ints(), rb_thread_io_blocking_region(), rb_thread_polling(), rb_thread_terminate_all(), sleep_forever(), and sleep_timeval().

#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 831 of file vm_core.h.

Referenced by current_method_entry(), rb_vm_get_binding_creatable_next_cfp(), rb_vm_get_ruby_level_next_cfp(), vm_get_ruby_level_caller_cfp(), vm_normal_frame(), vm_push_frame(), vm_rewrite_ep_in_errinfo(), and vm_search_superclass().

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

Definition at line 827 of file vm_core.h.

Referenced by backtrace_each(), errinfo_place(), and rb_profile_frames().

#define RUBY_VM_FIBER_MACHINE_STACK_SIZE   ( 64 * 1024 * sizeof(VALUE))

Definition at line 438 of file vm_core.h.

Referenced by vm_default_params_setup().

#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE))

Definition at line 439 of file vm_core.h.

Referenced by vm_default_params_setup().

#define RUBY_VM_FIBER_VM_STACK_SIZE   ( 16 * 1024 * sizeof(VALUE))

Definition at line 436 of file vm_core.h.

Referenced by vm_default_params_setup().

#define RUBY_VM_FIBER_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE))

Definition at line 437 of file vm_core.h.

Referenced by vm_default_params_setup().

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

Definition at line 838 of file vm_core.h.

Referenced by eval_string_with_cref(), rb_iterate(), vm_caller_setup_args(), and vm_make_proc_with_iseq().

#define RUBY_VM_GET_CFP_FROM_BLOCK_PTR (  )     ((rb_control_frame_t *)((VALUE *)(b) - 4))

Definition at line 839 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 834 of file vm_core.h.

Referenced by control_frame_dump(), frame_called_id(), frame_func_id(), proc_mark(), and rb_vm_control_frame_id_and_class().

#define RUBY_VM_INTERRUPTED ( th   )     ((th)->interrupt_flag & ~(th)->interrupt_mask & (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))

Definition at line 963 of file vm_core.h.

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

#define RUBY_VM_INTERRUPTED_ANY ( th   )     ((th)->interrupt_flag & ~(th)->interrupt_mask)

Definition at line 964 of file vm_core.h.

Referenced by rb_thread_schedule(), and set_unblock_function().

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

Definition at line 826 of file vm_core.h.

Referenced by backtrace_each().

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

Definition at line 835 of file vm_core.h.

Referenced by errinfo_place(), iseq_s_of(), 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_cref0(), vm_get_ruby_level_caller_cfp(), vm_make_env_each(), and vm_rewrite_ep_in_errinfo().

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

Definition at line 825 of file vm_core.h.

Referenced by current_method_entry(), errinfo_place(), method_entry_of_iseq(), previous_frame(), proc_new(), rb_current_realfilepath(), rb_f_block_given_p(), rb_f_local_variables(), rb_profile_frames(), rb_raise_jump(), rb_thread_mark(), rb_threadptr_exec_event_hooks_orig(), rb_vm_get_binding_creatable_next_cfp(), rb_vm_get_ruby_level_next_cfp(), rb_vm_make_binding(), rb_vm_stack_to_heap(), send_internal(), vm_base_ptr(), vm_call_iseq_setup_tailcall(), vm_exec(), vm_get_ruby_level_caller_cfp(), vm_normal_frame(), vm_pop_frame(), vm_push_frame(), vm_rewrite_ep_in_errinfo(), vm_search_superclass(), and vm_throw().

#define RUBY_VM_SET_INTERRUPT ( th   )     ATOMIC_OR((th)->interrupt_flag, PENDING_INTERRUPT_MASK)

Definition at line 960 of file vm_core.h.

Referenced by rb_fiber_start(), rb_thread_s_handle_interrupt(), and rb_threadptr_interrupt_common().

#define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT ( th   )     ATOMIC_OR((th)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK)

Definition at line 961 of file vm_core.h.

Referenced by postponed_job_register(), and rb_postponed_job_register_one().

#define RUBY_VM_SET_TIMER_INTERRUPT ( th   )     ATOMIC_OR((th)->interrupt_flag, TIMER_INTERRUPT_MASK)

Definition at line 959 of file vm_core.h.

Referenced by timer_thread_function().

#define RUBY_VM_SET_TRAP_INTERRUPT ( th   )     ATOMIC_OR((th)->interrupt_flag, TRAP_INTERRUPT_MASK)

Definition at line 962 of file vm_core.h.

Referenced by rb_threadptr_interrupt_common().

#define RUBY_VM_SIZE_ALIGN   4096

Definition at line 429 of file vm_core.h.

Referenced by get_param().

#define RUBY_VM_THREAD_MACHINE_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE))

Definition at line 433 of file vm_core.h.

Referenced by vm_default_params_setup().

#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE))

Definition at line 434 of file vm_core.h.

Referenced by vm_default_params_setup().

#define RUBY_VM_THREAD_MODEL   2

Definition at line 15 of file vm_core.h.

#define RUBY_VM_THREAD_VM_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE))

Definition at line 431 of file vm_core.h.

Referenced by vm_default_params_setup().

#define RUBY_VM_THREAD_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE))

Definition at line 432 of file vm_core.h.

Referenced by vm_default_params_setup().

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

Definition at line 829 of file vm_core.h.

Referenced by errinfo_place().

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

Definition at line 781 of file vm_core.h.

Referenced by backtrace_each().

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

Definition at line 853 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 854 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 899 of file vm_core.h.

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

#define UNINITIALIZED_VAR (  )     x

Definition at line 121 of file vm_core.h.

Referenced by BSD_vfprintf(), do_select(), rb_debug_inspector_open(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), and rb_str_enumerate_lines().

#define UNLIKELY (  )     (x)

Definition at line 109 of file vm_core.h.

Referenced by backtrace_collect(), exec_hooks_precheck(), GET_THREAD(), iseq_set_sequence(), newobj_of(), rb_method_call_status(), rb_thread_schedule(), ruby_register_rollback_func_for_ensure(), vm_call0_cfunc_with_frame(), vm_callee_setup_arg(), vm_caller_setup_args(), vm_exec(), vm_exec_core(), vm_getivar(), and vm_invoke_block().

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

Definition at line 58 of file vm_core.h.

#define VM_CALL_ARGS_BLOCKARG   (0x01 << 2)

Definition at line 745 of file vm_core.h.

Referenced by new_callinfo(), rb_insn_operand_intern(), setup_args(), and vm_caller_setup_args().

#define VM_CALL_ARGS_SKIP_SETUP   (0x01 << 8)

Definition at line 751 of file vm_core.h.

Referenced by iseq_specialized_instruction(), new_callinfo(), and rb_insn_operand_intern().

#define VM_CALL_ARGS_SPLAT   (0x01 << 1)

Definition at line 744 of file vm_core.h.

Referenced by iseq_compile_each(), new_callinfo(), rb_insn_operand_intern(), setup_args(), vm_call_method(), vm_callee_setup_arg(), vm_caller_setup_args(), and vm_invoke_block().

#define VM_CALL_FCALL   (0x01 << 3)

Definition at line 746 of file vm_core.h.

Referenced by iseq_compile_each(), rb_insn_operand_intern(), vm_call_method(), vm_call_method_missing(), and vm_call_opt_send().

#define VM_CALL_OPT_SEND   (0x01 << 7)

Definition at line 750 of file vm_core.h.

Referenced by rb_insn_operand_intern(), vm_call_method(), vm_call_method_missing(), and vm_call_opt_send().

#define VM_CALL_SUPER   (0x01 << 6)

Definition at line 749 of file vm_core.h.

Referenced by rb_insn_operand_intern(), and vm_call_method().

#define VM_CALL_TAILCALL   (0x01 << 5)

Definition at line 748 of file vm_core.h.

Referenced by iseq_peephole_optimize(), rb_insn_operand_intern(), vm_call_iseq_setup_2(), and vm_callee_setup_arg().

#define VM_CALL_VCALL   (0x01 << 4)

Definition at line 747 of file vm_core.h.

Referenced by iseq_compile_each(), rb_insn_operand_intern(), and vm_call_method().

#define VM_CHECKMATCH_ARRAY   0x04

Definition at line 742 of file vm_core.h.

Referenced by iseq_compile_each().

#define VM_CHECKMATCH_TYPE_MASK   0x03

Definition at line 741 of file vm_core.h.

#define VM_DEBUG_BP_CHECK   0

Definition at line 442 of file vm_core.h.

#define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS   0x10

Definition at line 667 of file vm_core.h.

#define VM_DEFINECLASS_FLAG_SCOPED   0x08

Definition at line 666 of file vm_core.h.

#define VM_DEFINECLASS_HAS_SUPERCLASS_P (  )     ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS)

Definition at line 669 of file vm_core.h.

#define VM_DEFINECLASS_SCOPED_P (  )     ((x) & VM_DEFINECLASS_FLAG_SCOPED)

Definition at line 668 of file vm_core.h.

#define VM_DEFINECLASS_TYPE (  )     ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK)

Definition at line 665 of file vm_core.h.

#define VM_ENVVAL_BLOCK_PTR (  )     (GC_GUARDED_PTR(v) | VM_ENVVAL_BLOCK_PTR_FLAG)

Definition at line 813 of file vm_core.h.

Referenced by fiber_init(), rb_vm_call_cfunc(), rb_yield_refine_block(), th_init(), vm_call0_cfunc_with_frame(), vm_call_cfunc_with_frame(), vm_call_iseq_setup_normal(), vm_call_iseq_setup_tailcall(), vm_make_env_object(), vm_set_top_stack(), and yield_under().

#define VM_ENVVAL_BLOCK_PTR_FLAG   0x02

Definition at line 812 of file vm_core.h.

#define VM_ENVVAL_BLOCK_PTR_P (  )     ((v) & VM_ENVVAL_BLOCK_PTR_FLAG)

Definition at line 814 of file vm_core.h.

#define VM_ENVVAL_PREV_EP_PTR (  )     ((VALUE)GC_GUARDED_PTR(v))

Definition at line 815 of file vm_core.h.

Referenced by invoke_block_from_c(), vm_invoke_block(), vm_make_env_each(), vm_set_eval_stack(), and vm_yield_with_cfunc().

#define VM_ENVVAL_PREV_EP_PTR_P (  )     (!(VM_ENVVAL_BLOCK_PTR_P(v)))

Definition at line 816 of file vm_core.h.

#define VM_EP_BLOCK_PTR ( ep   )     ((rb_block_t *)GC_GUARDED_PTR_REF((ep)[0]))

Definition at line 819 of file vm_core.h.

Referenced by VM_CF_BLOCK_PTR(), and vm_make_env_object().

#define VM_EP_LEP_P ( ep   )     VM_ENVVAL_BLOCK_PTR_P((ep)[0])

Definition at line 820 of file vm_core.h.

Referenced by rb_f_local_variables(), VM_EP_LEP(), and vm_get_cref0().

#define VM_EP_PREV_EP ( ep   )     ((VALUE *)GC_GUARDED_PTR_REF((ep)[0]))

Definition at line 818 of file vm_core.h.

Referenced by VM_CF_PREV_EP(), VM_EP_LEP(), vm_get_cref0(), vm_search_superclass(), and vm_throw().

#define VM_FRAME_FLAG_BMETHOD   0x0400

Definition at line 777 of file vm_core.h.

Referenced by invoke_block_from_c().

#define VM_FRAME_FLAG_FINISH   0x0200

Definition at line 776 of file vm_core.h.

Referenced by invoke_block_from_c(), rb_vm_call_cfunc(), th_init(), vm_call0_body(), vm_call_iseq_setup_tailcall(), vm_set_eval_stack(), and vm_set_top_stack().

#define VM_FRAME_FLAG_PASSED   0x0100

Definition at line 775 of file vm_core.h.

Referenced by vm_get_ruby_level_caller_cfp().

#define VM_FRAME_MAGIC_BLOCK   0x21

Definition at line 760 of file vm_core.h.

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

#define VM_FRAME_MAGIC_CFUNC   0x61

Definition at line 763 of file vm_core.h.

Referenced by control_frame_dump(), rb_vm_rewind_cfp(), vm_call0_cfunc_with_frame(), vm_call_cfunc_with_frame(), and vm_exec().

#define VM_FRAME_MAGIC_CLASS   0x31

Definition at line 761 of file vm_core.h.

Referenced by control_frame_dump().

#define VM_FRAME_MAGIC_EVAL   0x91

Definition at line 766 of file vm_core.h.

Referenced by control_frame_dump(), and vm_set_eval_stack().

#define VM_FRAME_MAGIC_IFUNC   0x81

Definition at line 765 of file vm_core.h.

Referenced by control_frame_dump(), and vm_yield_with_cfunc().

#define VM_FRAME_MAGIC_LAMBDA   0xa1

Definition at line 767 of file vm_core.h.

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

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

Definition at line 770 of file vm_core.h.

#define VM_FRAME_MAGIC_MASK_BITS   8

Definition at line 769 of file vm_core.h.

#define VM_FRAME_MAGIC_METHOD   0x11

Definition at line 759 of file vm_core.h.

Referenced by argument_error(), control_frame_dump(), vm_call_iseq_setup_normal(), and vm_call_iseq_setup_tailcall().

#define VM_FRAME_MAGIC_PROC   0x71

Definition at line 764 of file vm_core.h.

Referenced by control_frame_dump().

#define VM_FRAME_MAGIC_RESCUE   0xb1

Definition at line 768 of file vm_core.h.

Referenced by control_frame_dump().

#define VM_FRAME_MAGIC_TOP   0x41

Definition at line 762 of file vm_core.h.

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

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

Definition at line 772 of file vm_core.h.

Referenced by control_frame_dump(), rb_vm_rewind_cfp(), vm_exec(), and vm_throw().

#define VM_FRAME_TYPE_BMETHOD_P ( cfp   )     (((cfp)->flag & VM_FRAME_FLAG_BMETHOD) != 0)

Definition at line 779 of file vm_core.h.

#define VM_FRAME_TYPE_FINISH_P ( cfp   )     (((cfp)->flag & VM_FRAME_FLAG_FINISH) != 0)

Definition at line 778 of file vm_core.h.

Referenced by control_frame_dump(), rb_threadptr_exec_event_hooks_orig(), vm_call_iseq_setup_tailcall(), and vm_exec().

#define VM_STACK_OVERFLOWED_P ( cfp,
sp,
margin   ) 

Value:

(!RUBY_CONST_ASSERT(sizeof(*(sp)) == sizeof(VALUE)) || \
     !RUBY_CONST_ASSERT(sizeof(*(cfp)) == sizeof(rb_control_frame_t)) || \
     ((rb_control_frame_t *)((sp) + (margin)) + 1) >= (cfp))

Definition at line 902 of file vm_core.h.

#define WHEN_VM_STACK_OVERFLOWED ( cfp,
sp,
margin   )     if (LIKELY(!VM_STACK_OVERFLOWED_P(cfp, sp, margin))) {(void)0;} else

Definition at line 906 of file vm_core.h.


Typedef Documentation

typedef rb_call_info_t* CALL_INFO

Definition at line 786 of file vm_core.h.

typedef VALUE CDHASH

Definition at line 790 of file vm_core.h.

typedef struct iseq_inline_cache_entry* IC

Definition at line 785 of file vm_core.h.

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

Definition at line 885 of file vm_core.h.

typedef struct rb_block_struct rb_block_t

typedef struct rb_call_info_struct rb_call_info_t

typedef struct rb_compile_option_struct rb_compile_option_t

Definition at line 130 of file vm_core.h.

typedef struct rb_control_frame_struct rb_control_frame_t

typedef struct rb_ensure_entry rb_ensure_entry_t

typedef struct rb_ensure_list rb_ensure_list_t

typedef struct rb_hook_list_struct rb_hook_list_t

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

Definition at line 797 of file vm_core.h.

typedef struct rb_iseq_location_struct rb_iseq_location_t

typedef RUBY_JMP_BUF rb_jmpbuf_t

Definition at line 482 of file vm_core.h.

typedef unsigned long rb_num_t

Definition at line 124 of file vm_core.h.

typedef struct rb_thread_list_struct rb_thread_list_t

typedef struct rb_thread_struct rb_thread_t

typedef struct rb_vm_struct rb_vm_t


Enumeration Type Documentation

anonymous enum

Enumerator:
TIMER_INTERRUPT_MASK 
PENDING_INTERRUPT_MASK 
POSTPONED_JOB_INTERRUPT_MASK 
TRAP_INTERRUPT_MASK 

Definition at line 952 of file vm_core.h.

enum rb_thread_status

Enumerator:
THREAD_RUNNABLE 
THREAD_STOPPED 
THREAD_STOPPED_FOREVER 
THREAD_KILLED 

Definition at line 475 of file vm_core.h.

enum rb_vm_defineclass_type_t

Enumerator:
VM_DEFINECLASS_TYPE_CLASS 
VM_DEFINECLASS_TYPE_SINGLETON_CLASS 
VM_DEFINECLASS_TYPE_MODULE 
VM_DEFINECLASS_TYPE_MASK 

Definition at line 657 of file vm_core.h.

enum ruby_special_exceptions

Enumerator:
ruby_error_reenter 
ruby_error_nomemory 
ruby_error_sysstack 
ruby_error_closed_stream 
ruby_special_error_count 

Definition at line 326 of file vm_core.h.

enum vm_check_match_type

Enumerator:
VM_CHECKMATCH_TYPE_WHEN 
VM_CHECKMATCH_TYPE_CASE 
VM_CHECKMATCH_TYPE_RESCUE 

Definition at line 735 of file vm_core.h.

enum vm_special_object_type

Enumerator:
VM_SPECIAL_OBJECT_VMCORE 
VM_SPECIAL_OBJECT_CBASE 
VM_SPECIAL_OBJECT_CONST_BASE 

Definition at line 753 of file vm_core.h.


Function Documentation

static rb_thread_t* GET_THREAD ( void   )  [inline, static]

Definition at line 927 of file vm_core.h.

References rb_thread_struct::passed_ci, ruby_current_thread, and UNLIKELY.

Referenced by argument_error(), call_trace_func(), call_without_gvl(), check_match(), compile_err_append(), cont_capture(), cont_free(), cont_new(), cont_restore_thread(), do_select(), error_handle(), error_print(), eval_string_with_cref(), eval_under(), fiber_store(), fiber_switch(), fiber_t_alloc(), gc_event_hook_body(), gc_mark_roots(), get_errinfo(), get_trace_arg(), Init_Cont(), Init_heap(), Init_signal(), Init_Thread(), Init_VM(), location_to_str(), m_core_define_method(), m_core_define_singleton_method(), method_entry_of_iseq(), method_missing(), mod_using(), oldbt_init(), prepare_iseq_build(), prev_frame_callee(), prev_frame_func(), proc_call(), proc_new(), process_options(), rb_add_method(), rb_backtrace_print_as_bugreport(), rb_backtrace_print_to(), rb_binding_add_dynavars(), rb_binding_new(), rb_block_arity(), rb_block_given_p(), rb_bug(), rb_call(), rb_call0(), rb_call_super(), rb_catch_protect(), rb_check_deadlock(), rb_check_funcall(), rb_check_funcall_with_hook(), rb_cont_call(), rb_current_realfilepath(), rb_debug_inspector_open(), rb_dvar_defined(), rb_ensure(), rb_errinfo(), rb_eval_string_wrap(), rb_exec_end_proc(), rb_exit(), rb_f_abort(), rb_f_block_given_p(), rb_f_caller(), rb_f_caller_locations(), rb_f_kill(), rb_f_local_variables(), rb_fiber_current(), rb_fiber_start(), rb_frame_callee(), rb_frame_method_id_and_class(), rb_frame_pop(), rb_frame_this_func(), rb_funcall_passing_block(), rb_funcall_with_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_iter_break_value(), 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_with_block(), rb_method_missing(), rb_mod_refine(), rb_mutex_lock(), rb_mutex_owned_p(), rb_mutex_sleep_forever(), rb_mutex_trylock(), rb_mutex_unlock(), rb_mutex_wait_for(), rb_parse_in_eval(), rb_parse_in_main(), rb_postponed_job_flush(), rb_postponed_job_register(), rb_postponed_job_register_one(), rb_proc_call(), rb_proc_call_with_block(), rb_profile_frames(), 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_sourcefilename(), rb_sourceline(), rb_suppress_tracing(), rb_thread_alone(), rb_thread_atfork(), rb_thread_atfork_internal(), rb_thread_blocking_region_begin(), rb_thread_check_ints(), rb_thread_current(), rb_thread_exit(), rb_thread_fd_close(), rb_thread_io_blocking_region(), rb_thread_kill(), rb_thread_list(), rb_thread_main(), rb_thread_mark(), rb_thread_polling(), rb_thread_s_abort_exc(), rb_thread_s_abort_exc_set(), rb_thread_s_handle_interrupt(), rb_thread_s_pending_interrupt_p(), rb_thread_schedule(), rb_thread_schedule_limits(), rb_thread_shield_wait(), rb_thread_sleep_deadly(), rb_thread_sleep_forever(), rb_thread_terminate_all(), rb_thread_wait_for(), rb_throw_obj(), rb_uninterruptible(), rb_vm_backtrace_object(), rb_vm_call_cfunc(), rb_vm_cbase(), rb_vm_cref(), rb_vm_cref_in_context(), rb_vm_make_jump_tag_but_local_jump(), rb_vm_pop_cfunc_frame(), rb_vmdebug_stack_dump_raw_current(), rb_waitpid(), rb_yield_0(), rb_yield_block(), rb_yield_refine_block(), require_libraries(), return_fiber(), ruby_cleanup(), ruby_exec_internal(), ruby_finalize_1(), ruby_kill(), ruby_options(), ruby_stack_length(), ruby_thread_init(), safe_setter(), send_internal(), set_relation(), signal_exec(), stack_check(), thgroup_list(), thread_create_core(), thread_join(), thread_raise_m(), top_define_method(), top_include(), top_using(), tracepoint_inspect(), update_coverage(), vm_backtrace_print(), vm_base_ptr(), vm_make_proc_with_iseq(), vm_search_superclass(), vm_svar_get(), vm_svar_set(), and yield_under().

int rb_autoloading_value ( VALUE  mod,
ID  id,
VALUE *  value 
)

Definition at line 1715 of file variable.c.

References autoload_data(), check_autoload_data, Qundef, rb_thread_current(), autoload_data_i::thread, autoload_data_i::value, and VALUE.

Referenced by autoload_defined_p(), rb_const_defined_0(), rb_const_get_0(), and vm_get_ev_const().

VALUE* rb_binding_add_dynavars ( rb_binding_t bind,
int  dyncount,
const ID dynvars 
)

Definition at line 725 of file vm.c.

References ALLOCV_END, ALLOCV_N, rb_env_t::block, rb_binding_t::blockprocval, rb_thread_struct::cfp, rb_env_t::env, env, rb_binding_t::env, GET_THREAD(), GetEnvPtr, rb_block_struct::iseq, rb_iseq_location_struct::label, rb_iseq_struct::location, MEMCPY, NEW_NODE, node, NODE_SCOPE, numberof, rb_binding_t::path, rb_iseq_new(), rb_iseq_struct::self, RNode::tbl, RNode::u1, VALUE, vm_make_env_object(), vm_pop_frame(), and vm_set_eval_stack().

Referenced by bind_local_variable_set().

VALUE rb_binding_alloc ( VALUE  klass  ) 

Definition at line 287 of file proc.c.

References ruby_binding_data_type, TypedData_Make_Struct, and VALUE.

Referenced by binding_dup(), proc_binding(), and rb_vm_make_binding().

VALUE rb_binding_new_with_cfp ( rb_thread_t th,
const rb_control_frame_t src_cfp 
)

Definition at line 320 of file proc.c.

References rb_vm_make_binding().

Referenced by collect_caller_bindings(), rb_binding_new(), and rb_tracearg_binding().

void rb_gc_mark_machine_stack ( rb_thread_t th  ) 

Definition at line 3506 of file gc.c.

References GET_STACK_BOUNDS, rb_thread_struct::machine, rb_gc_mark_locations, rb_objspace, and VALUE.

Referenced by rb_thread_mark().

void rb_gc_mark_unlinked_live_method_entries ( void *  pvm  ) 

Definition at line 123 of file vm_method.c.

References rb_method_entry_struct::mark, unlinked_method_entry_list_entry::me, unlinked_method_entry_list_entry::next, rb_mark_method_entry(), and rb_vm_struct::unlinked_method_entry_list.

Referenced by gc_mark_roots().

VALUE rb_get_coverages ( void   ) 

Definition at line 5287 of file thread.c.

References GET_VM.

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

Definition at line 642 of file iseq.c.

References Qnil, and rb_iseq_compile_with_option().

VALUE rb_iseq_compile_on_base ( VALUE  src,
VALUE  file,
VALUE  line,
rb_block_t base_block 
)

Definition at line 648 of file iseq.c.

References Qnil, and rb_iseq_compile_with_option().

VALUE rb_iseq_compile_with_option ( VALUE  src,
VALUE  file,
VALUE  absolute_path,
VALUE  line,
rb_block_t base_block,
VALUE  opt 
)

Definition at line 589 of file iseq.c.

References rb_thread_struct::base_block, EXEC_TAG, GET_THREAD(), rb_block_struct::iseq, JUMP_TAG, rb_iseq_location_struct::label, rb_iseq_struct::location, make_compile_option(), node, NUM2INT, Qfalse, Qundef, rb_exc_raise(), rb_iseq_new_with_opt(), rb_parser_compile_file_path(), rb_parser_compile_string_path(), rb_parser_new(), rb_str_new2, RB_TYPE_P, rb_iseq_struct::self, StringValueCStr, T_FILE, TH_POP_TAG, TH_PUSH_TAG, and VALUE.

Referenced by eval_string_with_cref(), iseq_s_compile(), rb_iseq_compile(), and rb_iseq_compile_on_base().

VALUE rb_iseq_disasm ( VALUE  self  ) 

Definition at line 1378 of file iseq.c.

References rb_iseq_struct::catch_table, rb_iseq_struct::catch_table_size, catch_type(), if(), rb_iseq_struct::iseq, iseq_check(), iseq_inspect(), rb_iseq_struct::iseq_size, rb_ary_new(), rb_iseq_disasm(), 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, and VALUE.

Referenced by eval_string_with_cref(), Init_ISeq(), iseq_s_disasm(), iseq_setup(), 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 1286 of file iseq.c.

References find_line_no(), len, prev, PRIdSIZE, rb_insn_operand_intern(), rb_str_cat2(), rb_str_catf(), rb_str_concat(), rb_str_new(), RSTRING_LEN, RSTRING_PTR, and VALUE.

Referenced by rb_vmdebug_debug_print_pre().

RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_eval ( VALUE  iseqval  ) 

Definition at line 1642 of file vm.c.

References GET_THREAD(), RB_GC_GUARD, val, VALUE, vm_exec(), and vm_set_top_stack().

Referenced by iseq_eval(), and rb_load_internal0().

VALUE rb_iseq_eval_main ( VALUE  iseqval  ) 

Definition at line 1655 of file vm.c.

References GET_THREAD(), RB_GC_GUARD, val, VALUE, vm_exec(), and vm_set_main_stack().

Referenced by ruby_exec_internal().

RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_iseq_new ( NODE ,
VALUE  ,
VALUE  ,
VALUE  ,
VALUE  ,
enum  iseq_type 
)

Definition at line 413 of file iseq.c.

References COMPILE_OPTION_DEFAULT, INT2FIX, node, and rb_iseq_new_with_opt().

Referenced by Init_VM(), rb_binding_add_dynavars(), and rb_vm_call_cfunc().

VALUE rb_iseq_new_main ( NODE node,
VALUE  path,
VALUE  absolute_path 
)

Definition at line 428 of file iseq.c.

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

VALUE rb_iseq_new_top ( NODE node,
VALUE  name,
VALUE  path,
VALUE  absolute_path,
VALUE  parent 
)

Definition at line 421 of file iseq.c.

References COMPILE_OPTION_DEFAULT, INT2FIX, node, and rb_iseq_new_with_opt().

Referenced by rb_load_internal0().

VALUE rb_iseq_new_with_bopt ( NODE ,
VALUE  ,
VALUE  ,
VALUE  ,
VALUE  ,
VALUE  ,
enum  iseq_type,
VALUE   
)

Definition at line 464 of file iseq.c.

References COMPILE_OPTION_DEFAULT, node, and rb_iseq_new_with_bopt_and_opt().

VALUE rb_iseq_new_with_opt ( NODE ,
VALUE  ,
VALUE  ,
VALUE  ,
VALUE  ,
VALUE  ,
enum  iseq_type,
const rb_compile_option_t  
)

Definition at line 454 of file iseq.c.

References node, iseq_compile_data::option, 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_name_err_mesg_new ( VALUE  obj,
VALUE  mesg,
VALUE  recv,
VALUE  method 
)

Definition at line 1078 of file error.c.

References ALLOC_N, NAME_ERR_MESG_COUNT, name_err_mesg_data_type, RB_GC_GUARD, result, TypedData_Wrap_Struct, and VALUE.

Referenced by Init_Exception(), and make_no_method_exception().

void rb_objspace_free ( struct rb_objspace  ) 

Definition at line 890 of file gc.c.

References rb_objspace::eden_heap, free, free_stack_chunks(), gc_rest_sweep(), global_List, heap_page_free(), heap_pages_himem, heap_pages_length, heap_pages_lomem, heap_pages_sorted, heap_pages_used, list, rb_objspace::mark_stack, gc_list::next, NULL, rb_heap_struct::page_length, rb_heap_struct::pages, rb_objspace::profile, rb_objspace::records, rb_heap_struct::total_slots, and xfree.

Referenced by ruby_vm_destruct().

void rb_postponed_job_flush ( rb_vm_t vm  ) 

Definition at line 1512 of file vm_trace.c.

References ATOMIC_CAS, rb_postponed_job_struct::data, rb_thread_struct::errinfo, EXEC_TAG, rb_postponed_job_struct::func, GET_THREAD(), rb_thread_struct::interrupt_mask, rb_vm_struct::postponed_job_buffer, rb_vm_struct::postponed_job_index, POSTPONED_JOB_INTERRUPT_MASK, Qnil, TH_POP_TAG, TH_PUSH_TAG, VALUE, and rb_thread_struct::vm.

Referenced by rb_threadptr_execute_interrupts().

VALUE rb_proc_alloc ( VALUE  klass  ) 

Definition at line 87 of file proc.c.

References proc_data_type, and TypedData_Make_Struct.

Referenced by proc_dup(), and rb_vm_make_proc().

void rb_reset_coverages ( void   ) 

Definition at line 5300 of file thread.c.

References GET_VM, Qfalse, rb_remove_event_hook(), and update_coverage().

Referenced by rb_coverage_result().

void rb_set_coverages ( VALUE   ) 

Definition at line 5293 of file thread.c.

References GET_VM, Qnil, rb_add_event_hook(), RUBY_EVENT_COVERAGE, and update_coverage().

Referenced by rb_coverage_start().

int rb_signal_buff_size ( void   ) 

Definition at line 655 of file signal.c.

References signal_buff.

Referenced by rb_thread_check_trap_pending(), and rb_threadptr_check_signal().

void rb_signal_exec ( rb_thread_t th,
int  sig 
)

Definition at line 861 of file signal.c.

References rb_vm_struct::cmd, GET_VM, Qundef, rb_interrupt(), rb_threadptr_signal_exit(), rb_threadptr_signal_raise(), rb_vm_struct::safe, SIGINT, signal_exec(), rb_vm_struct::trap_list, and VALUE.

Referenced by rb_threadptr_execute_interrupts().

VALUE rb_thread_alloc ( VALUE  klass  ) 

Definition at line 2229 of file vm.c.

References ruby_thread_init(), thread_alloc(), and VALUE.

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

RUBY_SYMBOL_EXPORT_BEGIN int rb_thread_check_trap_pending ( void   ) 

Definition at line 1149 of file thread.c.

References rb_signal_buff_size().

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

Definition at line 1696 of file vm.c.

References rb_thread_struct::cfp, and rb_vm_control_frame_id_and_class().

Referenced by call_trace_func(), and rb_frame_method_id_and_class().

void rb_thread_reset_timer_thread ( void   ) 

Definition at line 3864 of file thread.c.

Referenced by after_exec_non_async_signal_safe().

void rb_thread_start_timer_thread ( void   ) 

Definition at line 3870 of file thread.c.

References system_working.

Referenced by after_exec_non_async_signal_safe().

void rb_thread_stop_timer_thread ( int   ) 

Definition at line 3856 of file thread.c.

Referenced by before_exec_non_async_signal_safe(), and ruby_cleanup().

void rb_thread_wakeup_timer_thread ( void   ) 

Referenced by sighandler().

void rb_threadptr_check_signal ( rb_thread_t mth  ) 

Definition at line 3815 of file thread.c.

References rb_signal_buff_size(), and rb_threadptr_trap_interrupt().

Referenced by rb_f_kill(), ruby_cleanup(), and timer_thread_function().

void rb_threadptr_exec_event_hooks ( struct rb_trace_arg_struct trace_arg  ) 

Definition at line 382 of file vm_trace.c.

References rb_threadptr_exec_event_hooks_orig().

void rb_threadptr_exec_event_hooks_and_pop_frame ( struct rb_trace_arg_struct trace_arg  ) 

Definition at line 376 of file vm_trace.c.

References rb_threadptr_exec_event_hooks_orig().

void rb_threadptr_execute_interrupts ( rb_thread_t ,
int   
)

Definition at line 1953 of file thread.c.

References rb_thread_struct::cfp, eKillSignal, err, eTerminateSignal, EXEC_EVENT_HOOK, INT2FIX, INTERRUPT_NONE, INTERRUPT_ON_BLOCKING, rb_vm_struct::main_thread, PENDING_INTERRUPT_MASK, POSTPONED_JOB_INTERRUPT_MASK, rb_blocking_region_buffer::prev_status, PRIdVALUE, rb_thread_struct::priority, Qundef, rb_thread_struct::raised_flag, rb_exc_raise(), rb_get_next_signal(), rb_postponed_job_flush(), rb_signal_exec(), rb_thread_schedule_limits(), rb_threadptr_pending_interrupt_active_p(), rb_threadptr_pending_interrupt_deque(), rb_threadptr_to_kill(), RUBY_INTERNAL_EVENT_SWITCH, rb_thread_struct::running_time_us, rb_control_frame_struct::self, rb_thread_struct::status, TAG_FATAL, thread_debug, THREAD_RUNNABLE, THREAD_STOPPED, THREAD_STOPPED_FOREVER, threadptr_get_interrupts(), TIMER_INTERRUPT_MASK, TRAP_INTERRUPT_MASK, VALUE, and rb_thread_struct::vm.

Referenced by rb_thread_execute_interrupts(), and rb_thread_schedule().

void rb_threadptr_interrupt ( rb_thread_t th  ) 

Definition at line 359 of file thread.c.

References rb_threadptr_interrupt_common().

Referenced by rb_thread_kill(), rb_threadptr_raise(), rb_threadptr_ready(), ruby_cleanup(), terminate_i(), thread_fd_close_i(), and thread_start_func_2().

int rb_threadptr_pending_interrupt_active_p ( rb_thread_t th  ) 

Definition at line 1653 of file thread.c.

References rb_thread_struct::pending_interrupt_queue_checked, and rb_threadptr_pending_interrupt_empty_p().

Referenced by rb_threadptr_execute_interrupts().

void rb_threadptr_pending_interrupt_clear ( rb_thread_t th  ) 

Definition at line 1538 of file thread.c.

References rb_thread_struct::pending_interrupt_queue, and rb_ary_clear().

Referenced by rb_threadptr_to_kill().

void rb_threadptr_pending_interrupt_enque ( rb_thread_t th,
VALUE  v 
)

Definition at line 1544 of file thread.c.

References rb_thread_struct::pending_interrupt_queue, rb_thread_struct::pending_interrupt_queue_checked, and rb_ary_push().

Referenced by rb_fiber_start(), rb_thread_kill(), rb_threadptr_raise(), terminate_i(), and thread_fd_close_i().

VALUE rb_threadptr_reset_recursive_data ( rb_thread_t th  ) 

Definition at line 4794 of file thread.c.

References Qnil, threadptr_local_aref(), threadptr_local_aset(), and VALUE.

Referenced by rb_threadptr_exec_event_hooks_orig().

void rb_threadptr_restore_recursive_data ( rb_thread_t th,
VALUE  old 
)

Definition at line 4802 of file thread.c.

References threadptr_local_aset().

Referenced by rb_threadptr_exec_event_hooks_orig().

void rb_threadptr_signal_exit ( rb_thread_t th  ) 

Definition at line 2070 of file thread.c.

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

Referenced by rb_signal_exec().

void rb_threadptr_signal_raise ( rb_thread_t th,
int  sig 
)

Definition at line 2060 of file thread.c.

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

Referenced by rb_signal_exec().

void rb_threadptr_unlock_all_locking_mutexes ( rb_thread_t th  ) 

Definition at line 404 of file thread.c.

References err, rb_thread_struct::keeping_mutexes, rb_mutex_struct::next_mutex, rb_bug(), rb_mutex_unlock_th(), and rb_mutex_struct::th.

Referenced by rb_thread_terminate_all(), ruby_cleanup(), and thread_start_func_2().

void rb_unlink_method_entry ( rb_method_entry_t me  ) 

Definition at line 114 of file vm_method.c.

References ALLOC, GET_VM, unlinked_method_entry_list_entry::me, and unlinked_method_entry_list_entry::next.

Referenced by rb_method_entry_make(), and remove_method().

void rb_vm_bugreport ( void   ) 

Definition at line 713 of file vm_dump.c.

References CLASS_OF, feof, GET_VM, len, LIMITED_NAME_LENGTH, rb_vm_struct::loaded_features, rb_vm_struct::progname, RARRAY_AREF, RARRAY_LEN, rb_backtrace_print_as_bugreport(), rb_class_name(), rb_print_backtrace(), RB_TYPE_P, RSTRING_PTR, SDR, T_CLASS, T_MODULE, T_STRING, type, and VALUE.

VALUE rb_vm_call ( rb_thread_t th,
VALUE  recv,
VALUE  id,
int  argc,
const VALUE *  argv,
const rb_method_entry_t me,
VALUE  defined_class 
)

Definition at line 244 of file vm_eval.c.

References vm_call0().

Referenced by rb_method_call_with_block().

void rb_vm_change_state ( void   ) 

rb_block_t* rb_vm_control_frame_block_ptr ( rb_control_frame_t cfp  ) 

Definition at line 59 of file vm.c.

References VM_CF_BLOCK_PTR().

Referenced by proc_new(), rb_block_arity(), rb_block_given_p(), and rb_mod_refine().

int rb_vm_control_frame_id_and_class ( const rb_control_frame_t cfp,
ID idp,
VALUE *  klassp 
)

Definition at line 1668 of file vm.c.

References rb_method_entry_struct::def, idIFUNC, rb_control_frame_struct::iseq, iseq_catch_table_entry::iseq, rb_method_entry_struct::klass, rb_control_frame_struct::me, rb_method_definition_struct::original_id, and RUBY_VM_IFUNC_P.

Referenced by fill_id_and_klass(), get_klass(), and rb_thread_method_id_and_class().

VALUE* rb_vm_ep_local_ep ( VALUE *  ep  ) 

Definition at line 34 of file vm.c.

References VM_EP_LEP().

Referenced by rb_fiber_start(), and thread_start_func_2().

rb_control_frame_t* rb_vm_get_binding_creatable_next_cfp ( rb_thread_t th,
const rb_control_frame_t cfp 
)

Definition at line 235 of file vm.c.

References rb_control_frame_struct::iseq, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, and RUBY_VM_PREVIOUS_CONTROL_FRAME.

Referenced by rb_tracearg_binding(), rb_vm_make_binding(), and rb_vm_stack_to_heap().

rb_control_frame_t* rb_vm_get_ruby_level_next_cfp ( rb_thread_t th,
const rb_control_frame_t cfp 
)

Definition at line 247 of file vm.c.

References rb_control_frame_struct::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(), fill_path_and_lineno(), rb_add_method(), rb_sourcefile(), rb_sourcefilename(), rb_sourceline(), rb_vm_cbase(), rb_vm_cref(), rb_vm_cref_in_context(), rb_vm_make_binding(), and vm_make_proc_with_iseq().

int rb_vm_get_sourceline ( const rb_control_frame_t  ) 

Definition at line 33 of file vm_backtrace.c.

References calc_lineno(), rb_control_frame_struct::iseq, rb_control_frame_struct::pc, and RUBY_VM_NORMAL_ISEQ_P.

Referenced by control_frame_dump(), fill_path_and_lineno(), rb_add_method(), rb_sourceline(), rb_thread_current_status(), and rb_vm_make_binding().

void rb_vm_gvl_destroy ( rb_vm_t vm  ) 

Definition at line 272 of file thread.c.

References rb_vm_struct::thread_destruct_lock.

Referenced by ruby_vm_destruct().

void rb_vm_inc_const_missing_count ( void   ) 

Definition at line 111 of file vm.c.

References ruby_vm_const_missing_count.

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

Definition at line 897 of file vm.c.

References rb_proc_t::block, rb_block_struct::klass, rb_block_struct::self, and vm_invoke_proc().

Referenced by proc_call(), rb_fiber_start(), rb_proc_call(), rb_proc_call_with_block(), thread_start_func_2(), vm_call0_body(), and vm_call_opt_call().

VALUE rb_vm_make_binding ( rb_thread_t th,
const rb_control_frame_t src_cfp 
)

Definition at line 694 of file vm.c.

References rb_binding_t::blockprocval, rb_binding_t::env, rb_binding_t::first_lineno, GetBindingPtr, rb_control_frame_struct::iseq, rb_iseq_struct::location, rb_iseq_location_struct::path, rb_binding_t::path, rb_binding_alloc(), rb_cBinding, rb_eRuntimeError, rb_raise(), rb_vm_get_binding_creatable_next_cfp(), rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), RUBY_VM_PREVIOUS_CONTROL_FRAME, VALUE, and vm_make_env_object().

Referenced by rb_binding_new_with_cfp().

VALUE rb_vm_make_env_object ( rb_thread_t th,
rb_control_frame_t cfp 
)

Definition at line 577 of file vm.c.

References VALUE, and vm_make_env_object().

Referenced by eval_string_with_cref(), 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 656 of file vm.c.

References rb_proc_t::block, rb_proc_t::blockprocval, check_env_value(), rb_proc_t::envval, rb_block_struct::ep, GetProcPtr, rb_block_struct::iseq, rb_block_struct::klass, rb_block_struct::proc, PROCDEBUG, rb_bug(), rb_proc_alloc(), 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, VALUE, vm_make_env_object(), and VMDEBUG.

Referenced by proc_new(), vm_make_proc_from_block(), vm_make_proc_with_iseq(), and vm_yield_with_cfunc().

void rb_vm_rewind_cfp ( rb_thread_t th,
rb_control_frame_t cfp 
)

Definition at line 291 of file vm.c.

References rb_thread_struct::cfp, rb_vm_pop_cfunc_frame(), VM_FRAME_MAGIC_CFUNC, VM_FRAME_TYPE, and vm_pop_frame().

Referenced by rb_catch_protect(), rb_iterate(), rb_protect(), and rb_rescue2().

void rb_vm_stack_to_heap ( rb_thread_t th  ) 

Definition at line 635 of file vm.c.

References rb_thread_struct::cfp, rb_vm_get_binding_creatable_next_cfp(), rb_vm_make_env_object(), and RUBY_VM_PREVIOUS_CONTROL_FRAME.

Referenced by cont_capture().

void rb_vmdebug_debug_print_post ( rb_thread_t th,
rb_control_frame_t cfp 
)

Definition at line 385 of file vm_dump.c.

References rb_thread_struct::cfp, rb_inspect(), rb_vmdebug_debug_print_register(), SDR2, StringValueCStr, and VALUE.

void rb_vmdebug_debug_print_pre ( rb_thread_t th,
rb_control_frame_t cfp,
VALUE *  _pc 
)

Definition at line 357 of file vm_dump.c.

References rb_control_frame_struct::iseq, rb_iseq_struct::iseq, rb_iseq_struct::iseq_encoded, rb_iseq_disasm_insn(), rb_vmdebug_debug_print_register(), rb_control_frame_struct::sp, rb_thread_struct::stack, VALUE, and VM_CFP_CNT.

void rb_vmdebug_stack_dump_raw ( rb_thread_t ,
rb_control_frame_t  
)

Definition at line 141 of file vm_dump.c.

References control_frame_dump(), rb_control_frame_struct::ep, GC_GUARDED_PTR_REF, PRIxVALUE, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_size, and VALUE.

Referenced by rb_vmdebug_stack_dump_raw_current(), and rb_vmdebug_stack_dump_th().

const char* ruby_node_name ( int  node  ) 

Definition at line 1603 of file iseq.c.

References rb_bug().

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

int ruby_thread_has_gvl_p ( void   ) 

Definition at line 1492 of file thread.c.

References rb_thread_struct::blocking_region_buffer.

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

void ruby_thread_init_stack ( rb_thread_t th  ) 

Definition at line 497 of file thread.c.

References rb_mutex_struct::th.

Referenced by Init_BareVM().


Variable Documentation

RUBY_EXTERN VALUE rb_cEnv

Definition at line 693 of file vm_core.h.

RUBY_EXTERN VALUE rb_cISeq

Definition at line 691 of file vm_core.h.

RUBY_EXTERN VALUE rb_cRubyVM

Definition at line 692 of file vm_core.h.

RUBY_EXTERN VALUE rb_mRubyVMFrozenCore

Definition at line 694 of file vm_core.h.

const rb_data_type_t ruby_binding_data_type

Definition at line 276 of file proc.c.

Referenced by eval_string_with_cref(), and rb_binding_alloc().

rb_thread_t* ruby_current_thread

Definition at line 104 of file vm.c.

Referenced by GET_THREAD(), and thread_free().

rb_vm_t* ruby_current_vm

Definition at line 105 of file vm.c.

Referenced by Init_BareVM(), Init_VM(), and ruby_vm_destruct().

const rb_data_type_t ruby_threadptr_data_type

Definition at line 2144 of file vm.c.

rb_event_flag_t ruby_vm_event_flags

Definition at line 106 of file vm.c.

Referenced by recalc_add_ruby_vm_event_flags(), and recalc_remove_ruby_vm_event_flags().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7