Ruby  2.0.0p648(2015-12-16revision53162)
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
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 <setjmp.h>
#include <signal.h>
#include <varargs.h>

Go to the source code of this file.

Data Structures

struct  iseq_inline_cache_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_thread_struct
 
struct  rb_proc_t
 
struct  rb_env_t
 
struct  rb_binding_t
 
struct  rb_trace_arg_struct
 

Macros

#define RUBY_VM_THREAD_MODEL   2
 
#define ENABLE_VM_OBJSPACE   1
 
#define NSIG   (_SIGMAX + 1) /* For QNX */
 
#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 RUBY_VM_SIZE_ALIGN   4096
 
#define RUBY_VM_THREAD_VM_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
 
#define RUBY_VM_THREAD_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
 
#define RUBY_VM_THREAD_MACHINE_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
 
#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
 
#define RUBY_VM_FIBER_VM_STACK_SIZE   ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
 
#define RUBY_VM_FIBER_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
 
#define RUBY_VM_FIBER_MACHINE_STACK_SIZE   ( 64 * 1024 * sizeof(VALUE)) /* 256 KB or 512 KB */
 
#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
 
#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) /* m(*args) */
 
#define VM_CALL_ARGS_BLOCKARG   (0x01 << 2) /* m(&block) */
 
#define VM_CALL_FCALL   (0x01 << 3) /* m(...) */
 
#define VM_CALL_VCALL   (0x01 << 4) /* m */
 
#define VM_CALL_TAILCALL   (0x01 << 5) /* located at tail position */
 
#define VM_CALL_SUPER   (0x01 << 6) /* super */
 
#define VM_CALL_OPT_SEND   (0x01 << 7) /* internal flag */
 
#define VM_CALL_ARGS_SKIP_SETUP   (0x01 << 8) /* (flag & (SPLAT|BLOCKARG)) && blockiseq == 0 */
 
#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_TYPE_FINISH_P(cfp)   (((cfp)->flag & VM_FRAME_FLAG_FINISH) != 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 CHECK_VM_STACK_OVERFLOW(cfp, margin)
 
#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_FINALIZER_INTERRUPT(th)   ATOMIC_OR((th)->interrupt_flag, FINALIZER_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 struct rb_compile_option_struct rb_compile_option_t
 
typedef struct rb_call_info_struct rb_call_info_t
 
typedef struct rb_iseq_location_struct rb_iseq_location_t
 
typedef struct rb_hook_list_struct rb_hook_list_t
 
typedef struct rb_vm_struct rb_vm_t
 
typedef struct rb_control_frame_struct rb_control_frame_t
 
typedef struct rb_block_struct rb_block_t
 
typedef RUBY_JMP_BUF rb_jmpbuf_t
 
typedef struct rb_thread_list_struct rb_thread_list_t
 
typedef struct rb_thread_struct rb_thread_t
 
typedef struct 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, FINALIZER_INTERRUPT_MASK = 0x04, TRAP_INTERRUPT_MASK = 0x08 }
 

Functions

void rb_objspace_free (struct rb_objspace *)
 
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. More...
 
const char * ruby_node_name (int node)
 
int rb_iseq_first_lineno (const rb_iseq_t *iseq)
 
void rb_vm_change_state (void)
 
VALUErb_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)
 
void rb_vmdebug_debug_print_post (rb_thread_t *th, rb_control_frame_t *cfp)
 
void rb_vm_bugreport (void)
 
VALUE rb_iseq_eval (VALUE iseqval)
 
VALUE rb_iseq_eval_main (VALUE iseqval)
 
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)
 
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)
 
void rb_vm_rewrite_cref_stack (NODE *node, VALUE old_klass, VALUE new_klass, NODE **new_cref_ptr)
 
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_thread_lock_unlock (rb_thread_lock_t *)
 
void rb_thread_lock_destroy (rb_thread_lock_t *)
 
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)
 
int rb_thread_check_trap_pending (void)
 
VALUE rb_get_coverages (void)
 
void rb_set_coverages (VALUE)
 
void rb_reset_coverages (void)
 

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
 
rb_thread_truby_current_thread
 
rb_vm_truby_current_vm
 
rb_event_flag_t ruby_vm_event_flags
 

Macro Definition Documentation

◆ CHECK_VM_STACK_OVERFLOW

#define CHECK_VM_STACK_OVERFLOW (   cfp,
  margin 
)
Value:
if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)(cfp))) { \
vm_stackoverflow(); \
} \
while (0)
if(dispIdMember==DISPID_VALUE)
Definition: win32ole.c:791
unsigned long VALUE
Definition: ruby.h:104

Definition at line 870 of file vm_core.h.

Referenced by eval_string_with_cref(), invoke_block_from_c(), vm_call0_body(), vm_call_iseq_setup_normal(), vm_call_iseq_setup_tailcall(), vm_call_method_missing(), vm_caller_setup_args(), vm_invoke_block(), vm_set_eval_stack(), vm_set_top_stack(), and vm_yield_setup_block_args().

◆ ENABLE_VM_OBJSPACE

#define ENABLE_VM_OBJSPACE   1

Definition at line 46 of file vm_core.h.

◆ EXEC_EVENT_HOOK

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

◆ EXEC_EVENT_HOOK_AND_POP_FRAME

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

Referenced by vm_exec().

◆ EXEC_EVENT_HOOK_ORIG

#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; \
else rb_threadptr_exec_event_hooks(&trace_arg); \
} \
} \
} while (0)
void rb_threadptr_exec_event_hooks_and_pop_frame(struct rb_trace_arg_struct *trace_arg)
Definition: vm_trace.c:333
#define UNLIKELY(x)
Definition: vm_core.h:115
rb_event_flag_t ruby_vm_event_flags
Definition: vm.c:98
rb_event_flag_t event
Definition: vm_core.h:963
void rb_threadptr_exec_event_hooks(struct rb_trace_arg_struct *trace_arg)
Definition: vm_trace.c:339
#define Qundef
Definition: ruby.h:436

Definition at line 981 of file vm_core.h.

◆ FUNC_FASTCALL

#define FUNC_FASTCALL (   x)    x

Definition at line 757 of file vm_core.h.

◆ GC_GUARDED_PTR

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

Definition at line 763 of file vm_core.h.

Referenced by collect_caller_bindings_cfunc(), and collect_caller_bindings_iseq().

◆ GC_GUARDED_PTR_P

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

Definition at line 765 of file vm_core.h.

◆ GC_GUARDED_PTR_REF

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

◆ GET_VM

#define GET_VM ( )    ruby_current_vm

◆ GetBindingPtr

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

◆ GetCoreDataFromValue

#define GetCoreDataFromValue (   obj,
  type,
  ptr 
)
Value:
do { \
(ptr) = (type*)DATA_PTR(obj); \
} while (0)
#define DATA_PTR(dta)
Definition: ruby.h:985
int type
Definition: tcltklib.c:111

Definition at line 176 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_str_ary(), and vm_backtrace_to_ary().

◆ GetEnvPtr

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

◆ GetISeqPtr

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

◆ GetProcPtr

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

◆ GetThreadPtr

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

◆ GetVMPtr

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

Definition at line 323 of file vm_core.h.

◆ LIKELY

#define LIKELY (   x)    (x)

◆ NSIG

#define NSIG   (_SIGMAX + 1) /* For QNX */

Definition at line 54 of file vm_core.h.

Referenced by esignal_init(), and trap_signm().

◆ OPT_CALL_CFUNC_WITHOUT_FRAME

#define OPT_CALL_CFUNC_WITHOUT_FRAME   0

Definition at line 886 of file vm_core.h.

◆ rb_thread_set_current

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

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

◆ rb_thread_set_current_raw

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

Definition at line 902 of file vm_core.h.

Referenced by Init_BareVM().

◆ RUBY_NSIG

#define RUBY_NSIG   NSIG

Definition at line 57 of file vm_core.h.

Referenced by rb_get_next_signal(), and rb_vm_mark().

◆ RUBY_VM_CHECK_INTS

#define RUBY_VM_CHECK_INTS (   th)
Value:
do { \
rb_threadptr_execute_interrupts(th, 0); \
} \
} while (0)
#define RUBY_VM_INTERRUPTED_ANY(th)
Definition: vm_core.h:927
#define UNLIKELY(x)
Definition: vm_core.h:115

Definition at line 955 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().

◆ RUBY_VM_CHECK_INTS_BLOCKING

#define RUBY_VM_CHECK_INTS_BLOCKING (   th)
Value:
do { \
th->pending_interrupt_queue_checked = 0; \
RUBY_VM_SET_INTERRUPT(th); \
rb_threadptr_execute_interrupts(th, 1); \
} \
else if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) { \
rb_threadptr_execute_interrupts(th, 1); \
} \
} while (0)
#define RUBY_VM_INTERRUPTED_ANY(th)
Definition: vm_core.h:927
#define UNLIKELY(x)
Definition: vm_core.h:115
static int rb_threadptr_pending_interrupt_empty_p(rb_thread_t *th)
Definition: thread.c:1556

Definition at line 944 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().

◆ RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P

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

◆ RUBY_VM_END_CONTROL_FRAME

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

Definition at line 791 of file vm_core.h.

Referenced by backtrace_each(), and errinfo_place().

◆ RUBY_VM_FIBER_MACHINE_STACK_SIZE

#define RUBY_VM_FIBER_MACHINE_STACK_SIZE   ( 64 * 1024 * sizeof(VALUE)) /* 256 KB or 512 KB */

Definition at line 418 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN

#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */

Definition at line 419 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_FIBER_VM_STACK_SIZE

#define RUBY_VM_FIBER_VM_STACK_SIZE   ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */

Definition at line 416 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_FIBER_VM_STACK_SIZE_MIN

#define RUBY_VM_FIBER_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */

Definition at line 417 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_GET_BLOCK_PTR_IN_CFP

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

◆ RUBY_VM_GET_CFP_FROM_BLOCK_PTR

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

Definition at line 803 of file vm_core.h.

Referenced by rb_vm_make_proc().

◆ RUBY_VM_IFUNC_P

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

◆ RUBY_VM_INTERRUPTED

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

Definition at line 926 of file vm_core.h.

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

◆ RUBY_VM_INTERRUPTED_ANY

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

Definition at line 927 of file vm_core.h.

Referenced by rb_thread_schedule(), and set_unblock_function().

◆ RUBY_VM_NEXT_CONTROL_FRAME

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

Definition at line 790 of file vm_core.h.

Referenced by backtrace_each().

◆ RUBY_VM_NORMAL_ISEQ_P

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

◆ RUBY_VM_PREVIOUS_CONTROL_FRAME

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

◆ RUBY_VM_SET_FINALIZER_INTERRUPT

#define RUBY_VM_SET_FINALIZER_INTERRUPT (   th)    ATOMIC_OR((th)->interrupt_flag, FINALIZER_INTERRUPT_MASK)

Definition at line 924 of file vm_core.h.

Referenced by slot_sweep().

◆ RUBY_VM_SET_INTERRUPT

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

◆ RUBY_VM_SET_TIMER_INTERRUPT

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

Definition at line 922 of file vm_core.h.

Referenced by timer_thread_function().

◆ RUBY_VM_SET_TRAP_INTERRUPT

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

Definition at line 925 of file vm_core.h.

Referenced by rb_threadptr_interrupt_common().

◆ RUBY_VM_SIZE_ALIGN

#define RUBY_VM_SIZE_ALIGN   4096

Definition at line 409 of file vm_core.h.

Referenced by get_param().

◆ RUBY_VM_THREAD_MACHINE_STACK_SIZE

#define RUBY_VM_THREAD_MACHINE_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */

Definition at line 413 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN

#define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN   ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */

Definition at line 414 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_THREAD_MODEL

#define RUBY_VM_THREAD_MODEL   2

Definition at line 15 of file vm_core.h.

◆ RUBY_VM_THREAD_VM_STACK_SIZE

#define RUBY_VM_THREAD_VM_STACK_SIZE   ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */

Definition at line 411 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_THREAD_VM_STACK_SIZE_MIN

#define RUBY_VM_THREAD_VM_STACK_SIZE_MIN   ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */

Definition at line 412 of file vm_core.h.

Referenced by vm_default_params_setup().

◆ RUBY_VM_VALID_CONTROL_FRAME_P

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

Definition at line 793 of file vm_core.h.

Referenced by errinfo_place().

◆ RUBYVM_CFUNC_FRAME_P

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

Definition at line 745 of file vm_core.h.

Referenced by backtrace_each().

◆ SDR

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

Definition at line 817 of file vm_core.h.

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

◆ SDR2

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

Definition at line 818 of file vm_core.h.

Referenced by rb_vmdebug_debug_print_post().

◆ sysstack_error

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

◆ UNINITIALIZED_VAR

#define UNINITIALIZED_VAR (   x)    x

◆ UNLIKELY

#define UNLIKELY (   x)    (x)

◆ va_init_list

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

Definition at line 64 of file vm_core.h.

◆ VM_CALL_ARGS_BLOCKARG

#define VM_CALL_ARGS_BLOCKARG   (0x01 << 2) /* m(&block) */

◆ VM_CALL_ARGS_SKIP_SETUP

#define VM_CALL_ARGS_SKIP_SETUP   (0x01 << 8) /* (flag & (SPLAT|BLOCKARG)) && blockiseq == 0 */

Definition at line 717 of file vm_core.h.

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

◆ VM_CALL_ARGS_SPLAT

#define VM_CALL_ARGS_SPLAT   (0x01 << 1) /* m(*args) */

◆ VM_CALL_FCALL

#define VM_CALL_FCALL   (0x01 << 3) /* m(...) */

◆ VM_CALL_OPT_SEND

#define VM_CALL_OPT_SEND   (0x01 << 7) /* internal flag */

◆ VM_CALL_SUPER

#define VM_CALL_SUPER   (0x01 << 6) /* super */

Definition at line 715 of file vm_core.h.

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

◆ VM_CALL_TAILCALL

#define VM_CALL_TAILCALL   (0x01 << 5) /* located at tail position */

◆ VM_CALL_VCALL

#define VM_CALL_VCALL   (0x01 << 4) /* m */

Definition at line 713 of file vm_core.h.

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

◆ VM_CHECKMATCH_ARRAY

#define VM_CHECKMATCH_ARRAY   0x04

Definition at line 708 of file vm_core.h.

Referenced by iseq_compile_each().

◆ VM_CHECKMATCH_TYPE_MASK

#define VM_CHECKMATCH_TYPE_MASK   0x03

Definition at line 707 of file vm_core.h.

◆ VM_DEBUG_BP_CHECK

#define VM_DEBUG_BP_CHECK   0

Definition at line 422 of file vm_core.h.

◆ VM_DEFINECLASS_FLAG_HAS_SUPERCLASS

#define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS   0x10

Definition at line 630 of file vm_core.h.

Referenced by iseq_compile_each().

◆ VM_DEFINECLASS_FLAG_SCOPED

#define VM_DEFINECLASS_FLAG_SCOPED   0x08

Definition at line 629 of file vm_core.h.

Referenced by iseq_compile_each().

◆ VM_DEFINECLASS_HAS_SUPERCLASS_P

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

Definition at line 632 of file vm_core.h.

◆ VM_DEFINECLASS_SCOPED_P

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

Definition at line 631 of file vm_core.h.

◆ VM_DEFINECLASS_TYPE

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

Definition at line 628 of file vm_core.h.

◆ VM_ENVVAL_BLOCK_PTR

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

◆ VM_ENVVAL_BLOCK_PTR_FLAG

#define VM_ENVVAL_BLOCK_PTR_FLAG   0x02

Definition at line 776 of file vm_core.h.

◆ VM_ENVVAL_BLOCK_PTR_P

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

Definition at line 778 of file vm_core.h.

◆ VM_ENVVAL_PREV_EP_PTR

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

◆ VM_ENVVAL_PREV_EP_PTR_P

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

Definition at line 780 of file vm_core.h.

◆ VM_EP_BLOCK_PTR

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

Definition at line 783 of file vm_core.h.

Referenced by VM_CF_BLOCK_PTR(), and vm_make_env_object().

◆ VM_EP_LEP_P

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

Definition at line 784 of file vm_core.h.

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

◆ VM_EP_PREV_EP

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

Definition at line 782 of file vm_core.h.

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

◆ VM_FRAME_FLAG_FINISH

#define VM_FRAME_FLAG_FINISH   0x0200

◆ VM_FRAME_FLAG_PASSED

#define VM_FRAME_FLAG_PASSED   0x0100

Definition at line 741 of file vm_core.h.

Referenced by vm_get_ruby_level_caller_cfp().

◆ VM_FRAME_MAGIC_BLOCK

#define VM_FRAME_MAGIC_BLOCK   0x21

Definition at line 726 of file vm_core.h.

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

◆ VM_FRAME_MAGIC_CFUNC

#define VM_FRAME_MAGIC_CFUNC   0x61

◆ VM_FRAME_MAGIC_CLASS

#define VM_FRAME_MAGIC_CLASS   0x31

Definition at line 727 of file vm_core.h.

Referenced by control_frame_dump(), and vm_exec().

◆ VM_FRAME_MAGIC_EVAL

#define VM_FRAME_MAGIC_EVAL   0x91

Definition at line 732 of file vm_core.h.

Referenced by control_frame_dump(), and vm_set_eval_stack().

◆ VM_FRAME_MAGIC_IFUNC

#define VM_FRAME_MAGIC_IFUNC   0x81

Definition at line 731 of file vm_core.h.

Referenced by control_frame_dump(), and vm_yield_with_cfunc().

◆ VM_FRAME_MAGIC_LAMBDA

#define VM_FRAME_MAGIC_LAMBDA   0xa1

Definition at line 733 of file vm_core.h.

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

◆ VM_FRAME_MAGIC_MASK

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

Definition at line 736 of file vm_core.h.

◆ VM_FRAME_MAGIC_MASK_BITS

#define VM_FRAME_MAGIC_MASK_BITS   8

Definition at line 735 of file vm_core.h.

◆ VM_FRAME_MAGIC_METHOD

#define VM_FRAME_MAGIC_METHOD   0x11

◆ VM_FRAME_MAGIC_PROC

#define VM_FRAME_MAGIC_PROC   0x71

Definition at line 730 of file vm_core.h.

Referenced by control_frame_dump().

◆ VM_FRAME_MAGIC_RESCUE

#define VM_FRAME_MAGIC_RESCUE   0xb1

Definition at line 734 of file vm_core.h.

Referenced by control_frame_dump(), and vm_exec().

◆ VM_FRAME_MAGIC_TOP

#define VM_FRAME_MAGIC_TOP   0x41

Definition at line 728 of file vm_core.h.

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

◆ VM_FRAME_TYPE

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

Definition at line 738 of file vm_core.h.

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

◆ VM_FRAME_TYPE_FINISH_P

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

Typedef Documentation

◆ CALL_INFO

Definition at line 750 of file vm_core.h.

◆ CDHASH

typedef VALUE CDHASH

Definition at line 754 of file vm_core.h.

◆ IC

typedef struct iseq_inline_cache_entry* IC

Definition at line 749 of file vm_core.h.

◆ rb_backtrace_iter_func

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

Definition at line 852 of file vm_core.h.

◆ rb_block_t

typedef struct rb_block_struct rb_block_t

◆ rb_call_info_t

◆ rb_compile_option_t

Definition at line 130 of file vm_core.h.

◆ rb_control_frame_t

◆ rb_hook_list_t

◆ rb_insn_func_t

Definition at line 761 of file vm_core.h.

◆ rb_iseq_location_t

◆ rb_jmpbuf_t

typedef RUBY_JMP_BUF rb_jmpbuf_t

Definition at line 462 of file vm_core.h.

◆ rb_num_t

typedef unsigned long rb_num_t

Definition at line 124 of file vm_core.h.

◆ rb_thread_list_t

◆ rb_thread_t

typedef struct rb_thread_struct rb_thread_t

◆ rb_vm_t

typedef struct rb_vm_struct rb_vm_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TIMER_INTERRUPT_MASK 
PENDING_INTERRUPT_MASK 
FINALIZER_INTERRUPT_MASK 
TRAP_INTERRUPT_MASK 

Definition at line 915 of file vm_core.h.

◆ rb_thread_status

Enumerator
THREAD_RUNNABLE 
THREAD_STOPPED 
THREAD_STOPPED_FOREVER 
THREAD_KILLED 

Definition at line 455 of file vm_core.h.

◆ 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 620 of file vm_core.h.

◆ ruby_special_exceptions

Enumerator
ruby_error_reenter 
ruby_error_nomemory 
ruby_error_sysstack 
ruby_error_closed_stream 
ruby_special_error_count 

Definition at line 315 of file vm_core.h.

◆ vm_check_match_type

Enumerator
VM_CHECKMATCH_TYPE_WHEN 
VM_CHECKMATCH_TYPE_CASE 
VM_CHECKMATCH_TYPE_RESCUE 

Definition at line 701 of file vm_core.h.

◆ vm_special_object_type

Enumerator
VM_SPECIAL_OBJECT_VMCORE 
VM_SPECIAL_OBJECT_CBASE 
VM_SPECIAL_OBJECT_CONST_BASE 

Definition at line 719 of file vm_core.h.

Function Documentation

◆ GET_THREAD()

static rb_thread_t* GET_THREAD ( void  )
inlinestatic

Definition at line 890 of file vm_core.h.

References rb_thread_struct::passed_ci, ruby_current_thread, and UNLIKELY.

Referenced by 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_marks(), 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(), m_core_set_postexe(), method_entry_of_iseq(), method_missing(), oldbt_init(), prepare_iseq_build(), proc_call(), proc_new(), process_options(), rb_add_method(), rb_backtrace_print_as_bugreport(), rb_binding_new(), rb_block_given_p(), rb_bug(), rb_call(), rb_call0(), rb_call_super(), rb_catch_obj(), 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_local_variables(), rb_fiber_current(), rb_fiber_start(), rb_frame_callee(), rb_frame_caller(), rb_frame_last_func(), 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_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_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_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_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_variable_get(), rb_thread_variable_set(), 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_make_jump_tag_but_local_jump(), rb_vm_pop_cfunc_frame(), rb_vmdebug_stack_dump_raw_current(), rb_waitpid(), rb_yield_0(), rb_yield_refine_block(), require_libraries(), return_fiber(), ruby_cleanup(), ruby_exec_internal(), ruby_finalize_1(), ruby_options(), ruby_stack_length(), ruby_thread_init(), run_finalizer(), safe_setter(), send_internal(), set_relation(), signal_exec(), slot_sweep(), 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_search_superclass(), vm_svar_get(), vm_svar_set(), and yield_under().

◆ rb_autoloading_value()

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

◆ rb_binding_alloc()

VALUE rb_binding_alloc ( VALUE  klass)

Definition at line 283 of file proc.c.

References binding_data_type, and TypedData_Make_Struct.

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

◆ rb_binding_new_with_cfp()

VALUE rb_binding_new_with_cfp ( rb_thread_t th,
const rb_control_frame_t src_cfp 
)

Definition at line 316 of file proc.c.

References rb_vm_make_binding().

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

◆ rb_gc_mark_machine_stack()

void rb_gc_mark_machine_stack ( rb_thread_t th)

Definition at line 2530 of file gc.c.

References GET_STACK_BOUNDS, rb_gc_mark_locations, and rb_objspace.

Referenced by rb_thread_mark().

◆ rb_gc_mark_unlinked_live_method_entries()

void rb_gc_mark_unlinked_live_method_entries ( void *  pvm)

◆ rb_get_coverages()

VALUE rb_get_coverages ( void  )

Definition at line 5191 of file thread.c.

References GET_VM.

Referenced by clear_coverage().

◆ rb_iseq_compile()

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

Definition at line 638 of file iseq.c.

References Qnil, and rb_iseq_compile_with_option().

◆ rb_iseq_compile_on_base()

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

Definition at line 644 of file iseq.c.

References Qnil, and rb_iseq_compile_with_option().

◆ 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 
)

◆ rb_iseq_disasm()

VALUE rb_iseq_disasm ( VALUE  self)

◆ rb_iseq_disasm_insn()

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 1266 of file iseq.c.

References find_line_no(), insn_operand_intern(), PRIdSIZE, rb_str_cat2(), rb_str_catf(), rb_str_concat(), rb_str_new(), RSTRING_LEN, and RSTRING_PTR.

Referenced by rb_iseq_disasm(), and rb_vmdebug_debug_print_pre().

◆ rb_iseq_eval()

VALUE rb_iseq_eval ( VALUE  iseqval)

Definition at line 1498 of file vm.c.

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

Referenced by iseq_eval(), and rb_load_internal().

◆ rb_iseq_eval_main()

VALUE rb_iseq_eval_main ( VALUE  iseqval)

Definition at line 1511 of file vm.c.

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

Referenced by ruby_exec_internal().

◆ rb_iseq_first_lineno()

int rb_iseq_first_lineno ( const rb_iseq_t iseq)

◆ rb_iseq_new()

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

Definition at line 410 of file iseq.c.

References COMPILE_OPTION_DEFAULT, INT2FIX, name, rb_iseq_new_with_opt(), and type.

Referenced by Init_VM(), and rb_vm_call_cfunc().

◆ rb_iseq_new_main()

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

◆ rb_iseq_new_top()

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

Definition at line 418 of file iseq.c.

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

Referenced by rb_load_internal().

◆ rb_iseq_new_with_bopt()

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

Definition at line 461 of file iseq.c.

References COMPILE_OPTION_DEFAULT, name, rb_iseq_new_with_bopt_and_opt(), and type.

◆ rb_iseq_new_with_opt()

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

◆ rb_name_err_mesg_new()

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

◆ rb_objspace_free()

void rb_objspace_free ( struct rb_objspace )

◆ rb_proc_alloc()

VALUE rb_proc_alloc ( VALUE  klass)

Definition at line 84 of file proc.c.

References proc_data_type, and TypedData_Make_Struct.

Referenced by proc_dup(), and rb_vm_make_proc().

◆ rb_reset_coverages()

void rb_reset_coverages ( void  )

Definition at line 5204 of file thread.c.

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

Referenced by rb_coverage_result().

◆ rb_set_coverages()

void rb_set_coverages ( VALUE  )

Definition at line 5197 of file thread.c.

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

Referenced by rb_coverage_start().

◆ rb_signal_buff_size()

int rb_signal_buff_size ( void  )

Definition at line 574 of file signal.c.

References signal_buff.

Referenced by rb_thread_check_trap_pending(), and rb_threadptr_check_signal().

◆ rb_signal_exec()

void rb_signal_exec ( rb_thread_t th,
int  sig 
)

◆ rb_thread_alloc()

VALUE rb_thread_alloc ( VALUE  klass)

Definition at line 2071 of file vm.c.

References ruby_thread_init(), and thread_alloc().

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

◆ rb_thread_check_trap_pending()

int rb_thread_check_trap_pending ( void  )

Definition at line 1108 of file thread.c.

References rb_signal_buff_size().

◆ rb_thread_lock_destroy()

void rb_thread_lock_destroy ( rb_thread_lock_t )

Definition at line 287 of file thread.c.

◆ rb_thread_lock_unlock()

void rb_thread_lock_unlock ( rb_thread_lock_t )

Definition at line 281 of file thread.c.

◆ rb_thread_method_id_and_class()

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

◆ rb_thread_reset_timer_thread()

void rb_thread_reset_timer_thread ( void  )

Definition at line 3784 of file thread.c.

Referenced by after_exec_non_async_signal_safe().

◆ rb_thread_start_timer_thread()

void rb_thread_start_timer_thread ( void  )

Definition at line 3790 of file thread.c.

References system_working.

Referenced by after_exec_non_async_signal_safe().

◆ rb_thread_stop_timer_thread()

void rb_thread_stop_timer_thread ( int  )

Definition at line 3776 of file thread.c.

Referenced by before_exec_non_async_signal_safe(), and ruby_cleanup().

◆ rb_thread_wakeup_timer_thread()

void rb_thread_wakeup_timer_thread ( void  )

Referenced by sighandler().

◆ rb_threadptr_check_signal()

void rb_threadptr_check_signal ( rb_thread_t mth)

Definition at line 3735 of file thread.c.

References rb_signal_buff_size(), and rb_threadptr_trap_interrupt().

Referenced by ruby_cleanup(), and timer_thread_function().

◆ rb_threadptr_exec_event_hooks()

void rb_threadptr_exec_event_hooks ( struct rb_trace_arg_struct trace_arg)

Definition at line 339 of file vm_trace.c.

References rb_threadptr_exec_event_hooks_orig().

◆ rb_threadptr_exec_event_hooks_and_pop_frame()

void rb_threadptr_exec_event_hooks_and_pop_frame ( struct rb_trace_arg_struct trace_arg)

Definition at line 333 of file vm_trace.c.

References rb_threadptr_exec_event_hooks_orig().

◆ rb_threadptr_execute_interrupts()

void rb_threadptr_execute_interrupts ( rb_thread_t ,
int   
)

◆ rb_threadptr_interrupt()

void rb_threadptr_interrupt ( rb_thread_t th)

◆ rb_threadptr_pending_interrupt_active_p()

int rb_threadptr_pending_interrupt_active_p ( rb_thread_t th)

◆ rb_threadptr_pending_interrupt_clear()

void rb_threadptr_pending_interrupt_clear ( rb_thread_t th)

Definition at line 1497 of file thread.c.

References rb_thread_struct::pending_interrupt_queue, and rb_ary_clear().

Referenced by rb_threadptr_to_kill().

◆ rb_threadptr_pending_interrupt_enque()

void rb_threadptr_pending_interrupt_enque ( rb_thread_t th,
VALUE  v 
)

◆ rb_threadptr_signal_exit()

void rb_threadptr_signal_exit ( rb_thread_t th)

◆ rb_threadptr_signal_raise()

void rb_threadptr_signal_raise ( rb_thread_t th,
int  sig 
)

◆ rb_threadptr_unlock_all_locking_mutexes()

void rb_threadptr_unlock_all_locking_mutexes ( rb_thread_t th)

◆ rb_unlink_method_entry()

void rb_unlink_method_entry ( rb_method_entry_t me)

◆ rb_vm_bugreport()

void rb_vm_bugreport ( void  )

◆ rb_vm_call()

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 243 of file vm_eval.c.

References argc, argv, and vm_call0().

Referenced by rb_method_call_with_block().

◆ rb_vm_change_state()

void rb_vm_change_state ( void  )

Definition at line 103 of file vm.c.

References INC_VM_STATE_VERSION.

◆ rb_vm_control_frame_block_ptr()

rb_block_t* rb_vm_control_frame_block_ptr ( rb_control_frame_t cfp)

Definition at line 61 of file vm.c.

References VM_CF_BLOCK_PTR().

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

◆ rb_vm_control_frame_id_and_class()

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

◆ rb_vm_ep_local_ep()

VALUE* rb_vm_ep_local_ep ( VALUE ep)

Definition at line 36 of file vm.c.

References VM_EP_LEP().

Referenced by rb_fiber_start().

◆ rb_vm_get_binding_creatable_next_cfp()

rb_control_frame_t* rb_vm_get_binding_creatable_next_cfp ( rb_thread_t th,
const rb_control_frame_t cfp 
)

◆ rb_vm_get_ruby_level_next_cfp()

rb_control_frame_t* rb_vm_get_ruby_level_next_cfp ( rb_thread_t th,
const rb_control_frame_t cfp 
)

◆ rb_vm_get_sourceline()

int rb_vm_get_sourceline ( const rb_control_frame_t )

◆ rb_vm_gvl_destroy()

void rb_vm_gvl_destroy ( rb_vm_t vm)

Definition at line 273 of file thread.c.

References rb_vm_struct::thread_destruct_lock.

Referenced by ruby_vm_destruct().

◆ rb_vm_inc_const_missing_count()

void rb_vm_inc_const_missing_count ( void  )

Definition at line 128 of file vm.c.

References ruby_vm_const_missing_count.

◆ rb_vm_invoke_proc()

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

◆ rb_vm_make_binding()

VALUE rb_vm_make_binding ( rb_thread_t th,
const rb_control_frame_t src_cfp 
)

◆ rb_vm_make_env_object()

VALUE rb_vm_make_env_object ( rb_thread_t th,
rb_control_frame_t cfp 
)

Definition at line 530 of file vm.c.

References vm_make_env_object().

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

◆ rb_vm_make_proc()

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

◆ rb_vm_rewind_cfp()

void rb_vm_rewind_cfp ( rb_thread_t th,
rb_control_frame_t cfp 
)

◆ rb_vm_rewrite_cref_stack()

void rb_vm_rewrite_cref_stack ( NODE node,
VALUE  old_klass,
VALUE  new_klass,
NODE **  new_cref_ptr 
)

Definition at line 299 of file vm_insnhelper.c.

References COPY_CREF_OMOD, NEW_CREF, and NULL.

Referenced by clone_method().

◆ rb_vm_stack_to_heap()

void rb_vm_stack_to_heap ( rb_thread_t th)

◆ rb_vmdebug_debug_print_post()

void rb_vmdebug_debug_print_post ( rb_thread_t th,
rb_control_frame_t cfp 
)

◆ rb_vmdebug_debug_print_pre()

void rb_vmdebug_debug_print_pre ( rb_thread_t th,
rb_control_frame_t cfp 
)

◆ rb_vmdebug_stack_dump_raw()

void rb_vmdebug_stack_dump_raw ( rb_thread_t ,
rb_control_frame_t  
)

◆ ruby_node_name()

const char* ruby_node_name ( int  node)

◆ ruby_thread_has_gvl_p()

int ruby_thread_has_gvl_p ( void  )

◆ ruby_thread_init_stack()

void ruby_thread_init_stack ( rb_thread_t th)

Definition at line 476 of file thread.c.

References rb_mutex_struct::th.

Referenced by Init_BareVM().

Variable Documentation

◆ rb_cEnv

RUBY_EXTERN VALUE rb_cEnv

Definition at line 659 of file vm_core.h.

◆ rb_cISeq

RUBY_EXTERN VALUE rb_cISeq

Definition at line 657 of file vm_core.h.

◆ rb_cRubyVM

RUBY_EXTERN VALUE rb_cRubyVM

Definition at line 658 of file vm_core.h.

◆ rb_mRubyVMFrozenCore

RUBY_EXTERN VALUE rb_mRubyVMFrozenCore

Definition at line 660 of file vm_core.h.

◆ ruby_current_thread

rb_thread_t* ruby_current_thread

Definition at line 96 of file vm.c.

Referenced by GET_THREAD(), and thread_free().

◆ ruby_current_vm

rb_vm_t* ruby_current_vm

Definition at line 97 of file vm.c.

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

◆ ruby_threadptr_data_type

const rb_data_type_t ruby_threadptr_data_type

Definition at line 1987 of file vm.c.

◆ ruby_vm_event_flags

rb_event_flag_t ruby_vm_event_flags

Definition at line 98 of file vm.c.

Referenced by recalc_add_ruby_vm_event_flags(), and recalc_remove_ruby_vm_event_flags().