Ruby  2.4.2p198(2017-09-14revision59899)
Macros | Functions | Variables
vm.c File Reference
#include "internal.h"
#include "ruby/vm.h"
#include "ruby/st.h"
#include "gc.h"
#include "vm_core.h"
#include "iseq.h"
#include "eval_intern.h"
#include "probes.h"
#include "probes_helper.h"
#include "vm_insnhelper.h"
#include "vm_exec.h"
#include "vm_insnhelper.c"
#include "vm_exec.c"
#include "vm_method.c"
#include "vm_eval.c"
#include "vm_call_iseq_optimized.inc"
Include dependency graph for vm.c:

Go to the source code of this file.

Macros

#define PROCDEBUG   0
 
#define ruby_vm_redefined_flag   GET_VM()->redefined_flag
 
#define S(s)   sym_##s = ID2SYM(rb_intern_const(#s))
 
#define SET(name, attr)
 
#define OP(mid_, bop_)   (mid = id##mid_, bop = BOP_##bop_, ruby_vm_redefined_flag[bop] = 0)
 
#define C(k)   add_opt_method(rb_c##k, mid, bop)
 
#define SET(name)   rb_hash_aset(result, ID2SYM(rb_intern(#name)), SIZET2NUM(vm->default_params.name));
 
#define USE_THREAD_DATA_RECYCLE   1
 
#define RECYCLE_MAX   64
 
#define thread_data_type   ruby_threadptr_data_type
 
#define REWIND_CFP(expr)
 

Functions

VALUE rb_str_concat_literals (size_t, const VALUE *)
 
 PUREFUNC (static inline const VALUE *VM_EP_LEP(const VALUE *))
 
static const VALUEVM_EP_LEP (const VALUE *ep)
 
static const rb_control_frame_trb_vm_search_cf_from_ep (const rb_thread_t *const th, const rb_control_frame_t *cfp, const VALUE *const ep)
 
const VALUErb_vm_ep_local_ep (const VALUE *ep)
 
 PUREFUNC (static inline const VALUE *VM_CF_LEP(const rb_control_frame_t *const cfp))
 
static const VALUEVM_CF_LEP (const rb_control_frame_t *const cfp)
 
static const VALUEVM_CF_PREV_EP (const rb_control_frame_t *const cfp)
 
 PUREFUNC (static inline VALUE VM_CF_BLOCK_HANDLER(const rb_control_frame_t *const cfp))
 
static VALUE VM_CF_BLOCK_HANDLER (const rb_control_frame_t *const cfp)
 
VALUE rb_vm_frame_block_handler (const rb_control_frame_t *cfp)
 
static struct rb_captured_blockVM_CFP_TO_CAPTURED_BLOCK (const rb_control_frame_t *cfp)
 
static rb_control_frame_tVM_CAPTURED_BLOCK_TO_CFP (const struct rb_captured_block *captured)
 
static int VM_BH_FROM_CFP_P (VALUE block_handler, const rb_control_frame_t *cfp)
 
static VALUE vm_passed_block_handler (rb_thread_t *th)
 
static rb_cref_tvm_cref_new0 (VALUE klass, rb_method_visibility_t visi, int module_func, rb_cref_t *prev_cref, int pushed_by_eval, int use_prev_prev)
 
static rb_cref_tvm_cref_new (VALUE klass, rb_method_visibility_t visi, int module_func, rb_cref_t *prev_cref, int pushed_by_eval)
 
static rb_cref_tvm_cref_new_use_prev (VALUE klass, rb_method_visibility_t visi, int module_func, rb_cref_t *prev_cref, int pushed_by_eval)
 
static rb_cref_tvm_cref_dup (const rb_cref_t *cref)
 
static rb_cref_tvm_cref_new_toplevel (rb_thread_t *th)
 
rb_cref_trb_vm_cref_new_toplevel (void)
 
static void vm_cref_dump (const char *mesg, const rb_cref_t *cref)
 
static void vm_bind_update_env (rb_binding_t *bind, VALUE envval)
 
static VALUE vm_make_env_object (rb_thread_t *th, rb_control_frame_t *cfp)
 
static VALUE vm_invoke_bmethod (rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, VALUE block_handler)
 
static VALUE vm_invoke_proc (rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, VALUE block_handler)
 
rb_serial_t rb_next_class_serial (void)
 
static void thread_free (void *ptr)
 
void rb_vm_inc_const_missing_count (void)
 
VALUE rb_class_path_no_cache (VALUE _klass)
 
int ruby_th_dtrace_setup (rb_thread_t *th, VALUE klass, ID id, struct ruby_dtrace_method_hook_args *args)
 
static VALUE vm_stat (int argc, VALUE *argv, VALUE self)
 
static void vm_set_top_stack (rb_thread_t *th, const rb_iseq_t *iseq)
 
static void vm_set_eval_stack (rb_thread_t *th, const rb_iseq_t *iseq, const rb_cref_t *cref, const struct rb_block *base_block)
 
static void vm_set_main_stack (rb_thread_t *th, const rb_iseq_t *iseq)
 
rb_control_frame_trb_vm_get_binding_creatable_next_cfp (const rb_thread_t *th, const rb_control_frame_t *cfp)
 
rb_control_frame_trb_vm_get_ruby_level_next_cfp (const rb_thread_t *th, const rb_control_frame_t *cfp)
 
static rb_control_frame_tvm_get_ruby_level_caller_cfp (const rb_thread_t *th, const rb_control_frame_t *cfp)
 
void rb_vm_pop_cfunc_frame (void)
 
void rb_vm_rewind_cfp (rb_thread_t *th, rb_control_frame_t *cfp)
 
void rb_frame_pop (void)
 
void ruby_vm_at_exit (void(*func)(rb_vm_t *))
 
static void ruby_vm_run_at_exit_hooks (rb_vm_t *vm)
 
static VALUE check_env_value (const rb_env_t *env)
 
static int check_env (const rb_env_t *env)
 
static void vm_block_handler_escape (rb_thread_t *th, VALUE block_handler, VALUE *procvalptr)
 
static VALUE vm_make_env_each (rb_thread_t *const th, rb_control_frame_t *const cfp)
 
void rb_vm_stack_to_heap (rb_thread_t *th)
 
const rb_env_trb_vm_env_prev_env (const rb_env_t *env)
 
static int collect_local_variables_in_iseq (const rb_iseq_t *iseq, const struct local_var_list *vars)
 
static void collect_local_variables_in_env (const rb_env_t *env, const struct local_var_list *vars)
 
static int vm_collect_local_variables_in_heap (rb_thread_t *th, const VALUE *ep, const struct local_var_list *vars)
 
VALUE rb_vm_env_local_variables (const rb_env_t *env)
 
VALUE rb_iseq_local_variables (const rb_iseq_t *iseq)
 
VALUE rb_proc_create_from_captured (VALUE klass, const struct rb_captured_block *captured, enum rb_block_type block_type, int8_t safe_level, int8_t is_from_method, int8_t is_lambda)
 
VALUE rb_proc_create (VALUE klass, const struct rb_block *block, int8_t safe_level, int8_t is_from_method, int8_t is_lambda)
 
VALUE rb_vm_make_proc (rb_thread_t *th, const struct rb_captured_block *captured, VALUE klass)
 
VALUE rb_vm_make_proc_lambda (rb_thread_t *th, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda)
 
VALUE rb_vm_make_binding (rb_thread_t *th, const rb_control_frame_t *src_cfp)
 
const VALUErb_binding_add_dynavars (rb_binding_t *bind, int dyncount, const ID *dynvars)
 
static VALUE invoke_block (rb_thread_t *th, const rb_iseq_t *iseq, VALUE self, const struct rb_captured_block *captured, const rb_cref_t *cref, VALUE type, int opt_pc)
 
static VALUE invoke_bmethod (rb_thread_t *th, const rb_iseq_t *iseq, VALUE self, const struct rb_captured_block *captured, const rb_callable_method_entry_t *me, VALUE type, int opt_pc)
 
static VALUE invoke_iseq_block_from_c (rb_thread_t *th, const struct rb_captured_block *captured, VALUE self, int argc, const VALUE *argv, VALUE passed_block_handler, const rb_cref_t *cref, const int splattable, int is_lambda)
 
static VALUE invoke_block_from_c_splattable (rb_thread_t *th, VALUE block_handler, int argc, const VALUE *argv, VALUE passed_block_handler, const rb_cref_t *cref, int splattable, int is_lambda)
 
static VALUE check_block_handler (rb_thread_t *th)
 
static VALUE vm_yield_with_cref (rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref, int is_lambda)
 
static VALUE vm_yield (rb_thread_t *th, int argc, const VALUE *argv)
 
static VALUE vm_yield_with_block (rb_thread_t *th, int argc, const VALUE *argv, VALUE block_handler)
 
static VALUE vm_yield_lambda_splattable (rb_thread_t *th, VALUE args)
 
static VALUE invoke_block_from_c_unsplattable (rb_thread_t *th, const struct rb_block *block, VALUE self, int argc, const VALUE *argv, VALUE passed_block_handler, int is_lambda)
 
VALUE rb_vm_invoke_proc (rb_thread_t *th, rb_proc_t *proc, int argc, const VALUE *argv, VALUE passed_block_handler)
 
static rb_control_frame_tvm_normal_frame (rb_thread_t *th, rb_control_frame_t *cfp)
 
static VALUE vm_cfp_svar_get (rb_thread_t *th, rb_control_frame_t *cfp, VALUE key)
 
static void vm_cfp_svar_set (rb_thread_t *th, rb_control_frame_t *cfp, VALUE key, const VALUE val)
 
static VALUE vm_svar_get (VALUE key)
 
static void vm_svar_set (VALUE key, VALUE val)
 
VALUE rb_backref_get (void)
 
void rb_backref_set (VALUE val)
 
VALUE rb_lastline_get (void)
 
void rb_lastline_set (VALUE val)
 
VALUE rb_sourcefilename (void)
 
const char * rb_sourcefile (void)
 
int rb_sourceline (void)
 
VALUE rb_source_location (int *pline)
 
const char * rb_source_loc (int *pline)
 
rb_cref_trb_vm_cref (void)
 
rb_cref_trb_vm_cref_replace_with_duplicated_cref (void)
 
const rb_cref_trb_vm_cref_in_context (VALUE self, VALUE cbase)
 
VALUE rb_vm_cbase (void)
 
static VALUE make_localjump_error (const char *mesg, VALUE value, int reason)
 
void rb_vm_localjump_error (const char *mesg, VALUE value, int reason)
 
VALUE rb_vm_make_jump_tag_but_local_jump (int state, VALUE val)
 
void rb_vm_jump_tag_but_local_jump (int state)
 
 NORETURN (static void vm_iter_break(rb_thread_t *th, VALUE val))
 
static rb_control_frame_tnext_not_local_frame (rb_control_frame_t *cfp)
 
static void vm_iter_break (rb_thread_t *th, VALUE val)
 
void rb_iter_break (void)
 
void rb_iter_break_value (VALUE val)
 
static int vm_redefinition_check_flag (VALUE klass)
 
static void rb_vm_check_redefinition_opt_method (const rb_method_entry_t *me, VALUE klass)
 
static enum rb_id_table_iterator_result check_redefined_method (ID mid, VALUE value, void *data)
 
void rb_vm_check_redefinition_by_prepend (VALUE klass)
 
static void add_opt_method (VALUE klass, ID mid, VALUE bop)
 
static void vm_init_redefined_flag (void)
 
static VALUE frame_return_value (const struct vm_throw_data *err)
 
static void hook_before_rewind (rb_thread_t *th, const rb_control_frame_t *cfp, int will_finish_vm_exec, int state, struct vm_throw_data *err)
 
static VALUE vm_exec (rb_thread_t *th)
 
VALUE rb_iseq_eval (const rb_iseq_t *iseq)
 
VALUE rb_iseq_eval_main (const rb_iseq_t *iseq)
 
int rb_vm_control_frame_id_and_class (const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp)
 
int rb_thread_method_id_and_class (rb_thread_t *th, ID *idp, ID *called_idp, VALUE *klassp)
 
int rb_frame_method_id_and_class (ID *idp, VALUE *klassp)
 
VALUE rb_thread_current_status (const rb_thread_t *th)
 
VALUE rb_vm_call_cfunc (VALUE recv, VALUE(*func)(VALUE), VALUE arg, VALUE block_handler, VALUE filename)
 
void rb_vm_trace_mark_event_hooks (rb_hook_list_t *hooks)
 
void rb_vm_mark (void *ptr)
 
void rb_vm_register_special_exception (enum ruby_special_exceptions sp, VALUE cls, const char *mesg)
 
int rb_vm_add_root_module (ID id, VALUE module)
 
static int free_loading_table_entry (st_data_t key, st_data_t value, st_data_t arg)
 
int ruby_vm_destruct (rb_vm_t *vm)
 
static size_t vm_memsize (const void *ptr)
 
static VALUE vm_default_params (void)
 
static size_t get_param (const char *name, size_t default_value, size_t min_value)
 
static void check_machine_stack_size (size_t *sizep)
 
static void vm_default_params_setup (rb_vm_t *vm)
 
static void vm_init2 (rb_vm_t *vm)
 
static VALUEthread_recycle_stack (size_t size)
 
void rb_thread_recycle_stack_release (VALUE *stack)
 
void rb_fiber_mark_self (rb_fiber_t *fib)
 
void rb_thread_mark (void *ptr)
 
static size_t thread_memsize (const void *ptr)
 
VALUE rb_obj_is_thread (VALUE obj)
 
static VALUE thread_alloc (VALUE klass)
 
static void th_init (rb_thread_t *th, VALUE self)
 
static VALUE ruby_thread_init (VALUE self)
 
VALUE rb_thread_alloc (VALUE klass)
 
static void vm_define_method (rb_thread_t *th, VALUE obj, ID id, VALUE iseqval, int is_singleton)
 
static VALUE m_core_define_method (VALUE self, VALUE sym, VALUE iseqval)
 
static VALUE m_core_define_singleton_method (VALUE self, VALUE cbase, VALUE sym, VALUE iseqval)
 
static VALUE m_core_set_method_alias (VALUE self, VALUE cbase, VALUE sym1, VALUE sym2)
 
static VALUE m_core_set_variable_alias (VALUE self, VALUE sym1, VALUE sym2)
 
static VALUE m_core_undef_method (VALUE self, VALUE cbase, VALUE sym)
 
static VALUE m_core_set_postexe (VALUE self)
 
static VALUE core_hash_merge_ary (VALUE hash, VALUE ary)
 
static VALUE core_hash_from_ary (VALUE ary)
 
static VALUE core_hash_merge_kwd (int argc, VALUE *argv)
 
static VALUE core_hash_merge (VALUE hash, long argc, const VALUE *argv)
 
static VALUE m_core_hash_from_ary (VALUE self, VALUE ary)
 
static VALUE m_core_hash_merge_ptr (int argc, VALUE *argv, VALUE recv)
 
static int kwmerge_i (VALUE key, VALUE value, VALUE hash)
 
static int kwcheck_i (VALUE key, VALUE value, VALUE hash)
 
static VALUE m_core_hash_merge_kwd (int argc, VALUE *argv, VALUE recv)
 
static VALUE sdr (void)
 
static VALUE nsdr (void)
 
void Init_VM (void)
 
void rb_vm_set_progname (VALUE filename)
 
void Init_BareVM (void)
 
void Init_vm_objects (void)
 
static VALUE main_to_s (VALUE obj)
 
VALUE rb_vm_top_self (void)
 
void Init_top_self (void)
 
static VALUEruby_vm_verbose_ptr (rb_vm_t *vm)
 
static VALUEruby_vm_debug_ptr (rb_vm_t *vm)
 
VALUErb_ruby_verbose_ptr (void)
 
VALUErb_ruby_debug_ptr (void)
 
VALUE rb_insn_operand_intern (const rb_iseq_t *iseq, VALUE insn, int op_no, VALUE op, int len, size_t pos, VALUE *pnop, VALUE child)
 
st_tablerb_vm_fstring_table (void)
 

Variables

static rb_serial_t ruby_vm_global_method_state = 1
 
static rb_serial_t ruby_vm_global_constant_state = 1
 
static rb_serial_t ruby_vm_class_serial = 1
 
VALUE rb_cRubyVM
 
VALUE rb_cThread
 
VALUE rb_mRubyVMFrozenCore
 
VALUE ruby_vm_const_missing_count = 0
 
rb_thread_truby_current_thread = 0
 
rb_vm_truby_current_vm = 0
 
rb_event_flag_t ruby_vm_event_flags
 
static st_tablevm_opt_method_table = 0
 
static const rb_data_type_t vm_data_type
 
static VALUEthread_recycle_stack_slot [RECYCLE_MAX]
 
static int thread_recycle_stack_count = 0
 
const rb_data_type_t ruby_threadptr_data_type
 
VALUErb_gc_stack_start
 
size_t rb_gc_stack_maxsize
 
const struct st_hash_type rb_fstring_hash_type
 
void(* ruby_vm_collect_usage_func_insn )(int insn) = NULL
 
void(* ruby_vm_collect_usage_func_operand )(int insn, int n, VALUE op) = NULL
 
void(* ruby_vm_collect_usage_func_register )(int reg, int isset) = NULL
 

Macro Definition Documentation

◆ C

#define C (   k)    add_opt_method(rb_c##k, mid, bop)

◆ OP

#define OP (   mid_,
  bop_ 
)    (mid = id##mid_, bop = BOP_##bop_, ruby_vm_redefined_flag[bop] = 0)

Referenced by vm_init_redefined_flag().

◆ PROCDEBUG

#define PROCDEBUG   0

Definition at line 302 of file vm.c.

Referenced by vm_make_env_object().

◆ RECYCLE_MAX

#define RECYCLE_MAX   64

Definition at line 2315 of file vm.c.

Referenced by rb_thread_recycle_stack_release().

◆ REWIND_CFP

#define REWIND_CFP (   expr)
Value:
do { \
rb_thread_t *th__ = GET_THREAD(); \
VALUE *const curr_sp = (th__->cfp++)->sp; \
VALUE *const saved_sp = th__->cfp->sp; \
th__->cfp->sp = curr_sp; \
expr; \
(th__->cfp--)->sp = saved_sp; \
} while (0)
#define GET_THREAD()
Definition: vm_core.h:1513

Definition at line 2599 of file vm.c.

Referenced by core_hash_from_ary(), m_core_define_method(), m_core_define_singleton_method(), m_core_hash_from_ary(), m_core_hash_merge_kwd(), m_core_hash_merge_ptr(), m_core_set_method_alias(), m_core_set_variable_alias(), and m_core_undef_method().

◆ ruby_vm_redefined_flag

#define ruby_vm_redefined_flag   GET_VM()->redefined_flag

Definition at line 314 of file vm.c.

Referenced by rb_vm_check_redefinition_opt_method().

◆ S

#define S (   s)    sym_##s = ID2SYM(rb_intern_const(#s))

Referenced by vm_stat().

◆ SET [1/2]

#define SET (   name,
  attr 
)
Value:
if (key == sym_##name) \
return SERIALT2NUM(attr); \
else if (hash != Qnil) \
rb_hash_aset(hash, sym_##name, SERIALT2NUM(attr));
static unsigned int hash(str, len) register const char *str
#define SERIALT2NUM
Definition: internal.h:651
#define Qnil
Definition: ruby.h:438
const char * name
Definition: nkf.c:208

Referenced by vm_default_params(), and vm_stat().

◆ SET [2/2]

◆ thread_data_type

#define thread_data_type   ruby_threadptr_data_type

Definition at line 2475 of file vm.c.

Referenced by Init_VM(), rb_obj_is_thread(), and thread_alloc().

◆ USE_THREAD_DATA_RECYCLE

#define USE_THREAD_DATA_RECYCLE   1

Definition at line 2312 of file vm.c.

Function Documentation

◆ add_opt_method()

static void add_opt_method ( VALUE  klass,
ID  mid,
VALUE  bop 
)
static

◆ check_block_handler()

static VALUE check_block_handler ( rb_thread_t th)
inlinestatic

◆ check_env()

static int check_env ( const rb_env_t env)
static

Definition at line 589 of file vm.c.

References check_env_value(), dp, rb_env_t::ep, and rb_vm_env_prev_env().

Referenced by check_env_value().

◆ check_env_value()

static VALUE check_env_value ( const rb_env_t env)
static

Definition at line 605 of file vm.c.

References check_env(), env, Qnil, and rb_bug().

Referenced by check_env(), ruby_vm_run_at_exit_hooks(), and vm_make_env_object().

◆ check_machine_stack_size()

static void check_machine_stack_size ( size_t *  sizep)
static

Definition at line 2259 of file vm.c.

References size.

Referenced by vm_default_params_setup().

◆ check_redefined_method()

static enum rb_id_table_iterator_result check_redefined_method ( ID  mid,
VALUE  value,
void *  data 
)
static

◆ collect_local_variables_in_env()

static void collect_local_variables_in_env ( const rb_env_t env,
const struct local_var_list vars 
)
static

◆ collect_local_variables_in_iseq()

static int collect_local_variables_in_iseq ( const rb_iseq_t iseq,
const struct local_var_list vars 
)
static

◆ core_hash_from_ary()

static VALUE core_hash_from_ary ( VALUE  ary)
static

◆ core_hash_merge()

static VALUE core_hash_merge ( VALUE  hash,
long  argc,
const VALUE argv 
)
static

Definition at line 2666 of file vm.c.

References argc, Check_Type, hash(), rb_hash_aset(), T_HASH, and VM_ASSERT.

Referenced by core_hash_merge_ary(), and m_core_hash_merge_ptr().

◆ core_hash_merge_ary()

static VALUE core_hash_merge_ary ( VALUE  hash,
VALUE  ary 
)
static

Definition at line 2705 of file vm.c.

References Check_Type, core_hash_merge(), hash(), RARRAY_CONST_PTR, RARRAY_LEN, and T_ARRAY.

Referenced by core_hash_from_ary(), and m_core_set_postexe().

◆ core_hash_merge_kwd()

static VALUE core_hash_merge_kwd ( int  argc,
VALUE argv 
)
static

◆ frame_return_value()

static VALUE frame_return_value ( const struct vm_throw_data err)
static

◆ free_loading_table_entry()

static int free_loading_table_entry ( st_data_t  key,
st_data_t  value,
st_data_t  arg 
)
static

Definition at line 2163 of file vm.c.

References ST_DELETE, and xfree().

Referenced by ruby_vm_destruct().

◆ get_param()

static size_t get_param ( const char *  name,
size_t  default_value,
size_t  min_value 
)
static

Definition at line 2242 of file vm.c.

References getenv, PRIuSIZE, result, and RUBY_VM_SIZE_ALIGN.

Referenced by vm_default_params_setup().

◆ hook_before_rewind()

static void hook_before_rewind ( rb_thread_t th,
const rb_control_frame_t cfp,
int  will_finish_vm_exec,
int  state,
struct vm_throw_data err 
)
static

◆ Init_BareVM()

void Init_BareVM ( void  )

◆ Init_top_self()

void Init_top_self ( void  )

◆ Init_VM()

void Init_VM ( void  )

Definition at line 2806 of file vm.c.

References rb_thread_struct::cfp, CLASS_OF, rb_control_frame_struct::ep, FALSE, GET_THREAD, id_core_define_method, id_core_define_singleton_method, id_core_hash_from_ary, id_core_hash_merge_ary, id_core_hash_merge_kwd, id_core_hash_merge_ptr, id_core_set_method_alias, id_core_set_postexe, id_core_set_variable_alias, id_core_undef_method, Init_vm_backtrace(), rb_captured_block::iseq, rb_control_frame_struct::iseq, m_core_define_method(), m_core_define_singleton_method(), m_core_hash_from_ary(), m_core_hash_merge_kwd(), m_core_hash_merge_ptr(), m_core_set_method_alias(), m_core_set_postexe(), m_core_set_variable_alias(), m_core_undef_method(), rb_vm_struct::main_thread, METHOD_VISI_PRIVATE, nsdr(), NULL, rb_control_frame_struct::pc, Qnil, rb_ary_new(), rb_ary_push(), rb_binding_new(), rb_block_lambda(), rb_block_proc(), rb_cBasicObject, rb_class_new(), rb_cObject, rb_define_class(), rb_define_const(), rb_define_global_const(), rb_define_method_id(), rb_define_singleton_method(), rb_fstring_cstr(), rb_gc_register_mark_object(), rb_hash_new(), rb_insns_name_array(), rb_iseq_new(), rb_iv_set(), rb_obj_freeze(), rb_singleton_class(), rb_str_new2, rb_thread_set_current, rb_undef_alloc_func(), rb_undef_method(), rb_vm_living_threads_insert(), rb_vm_top_self(), RBASIC, RBASIC_CLEAR_CLASS, ruby_current_vm, rb_vm_struct::running_thread, sdr(), rb_vm_struct::self, rb_control_frame_struct::self, rb_thread_struct::self, T_ICLASS, thread_data_type, rb_thread_struct::top_self, rb_thread_struct::top_wrapper, TypedData_Wrap_Struct, rb_thread_struct::vm, vm_cref_new(), vm_default_params(), VM_ENV_DATA_INDEX_ME_CREF, VM_ENV_FLAGS_UNSET(), VM_FRAME_FLAG_CFRAME, vm_init_redefined_flag(), VM_PROFILE_ATEXIT, VM_STACK_ENV_WRITE(), and vm_stat().

◆ Init_vm_objects()

void Init_vm_objects ( void  )

◆ invoke_block()

static VALUE invoke_block ( rb_thread_t th,
const rb_iseq_t iseq,
VALUE  self,
const struct rb_captured_block captured,
const rb_cref_t cref,
VALUE  type,
int  opt_pc 
)
inlinestatic

◆ invoke_block_from_c_splattable()

static VALUE invoke_block_from_c_splattable ( rb_thread_t th,
VALUE  block_handler,
int  argc,
const VALUE argv,
VALUE  passed_block_handler,
const rb_cref_t cref,
int  splattable,
int  is_lambda 
)
inlinestatic

◆ invoke_block_from_c_unsplattable()

static VALUE invoke_block_from_c_unsplattable ( rb_thread_t th,
const struct rb_block block,
VALUE  self,
int  argc,
const VALUE argv,
VALUE  passed_block_handler,
int  is_lambda 
)
inlinestatic

◆ invoke_bmethod()

static VALUE invoke_bmethod ( rb_thread_t th,
const rb_iseq_t iseq,
VALUE  self,
const struct rb_captured_block captured,
const rb_callable_method_entry_t me,
VALUE  type,
int  opt_pc 
)
static

◆ invoke_iseq_block_from_c()

static VALUE invoke_iseq_block_from_c ( rb_thread_t th,
const struct rb_captured_block captured,
VALUE  self,
int  argc,
const VALUE argv,
VALUE  passed_block_handler,
const rb_cref_t cref,
const int  splattable,
int  is_lambda 
)
inlinestatic

◆ kwcheck_i()

static int kwcheck_i ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 2731 of file vm.c.

References Check_Type, ST_CONTINUE, and T_SYMBOL.

Referenced by core_hash_merge_kwd().

◆ kwmerge_i()

static int kwmerge_i ( VALUE  key,
VALUE  value,
VALUE  hash 
)
static

Definition at line 2723 of file vm.c.

References Check_Type, rb_hash_aset(), ST_CONTINUE, and T_SYMBOL.

Referenced by core_hash_merge_kwd().

◆ m_core_define_method()

static VALUE m_core_define_method ( VALUE  self,
VALUE  sym,
VALUE  iseqval 
)
static

Definition at line 2609 of file vm.c.

References FALSE, GET_THREAD, Qnil, REWIND_CFP, sym, SYM2ID, and vm_define_method().

Referenced by Init_VM().

◆ m_core_define_singleton_method()

static VALUE m_core_define_singleton_method ( VALUE  self,
VALUE  cbase,
VALUE  sym,
VALUE  iseqval 
)
static

Definition at line 2618 of file vm.c.

References GET_THREAD, REWIND_CFP, sym, SYM2ID, TRUE, and vm_define_method().

Referenced by Init_VM().

◆ m_core_hash_from_ary()

static VALUE m_core_hash_from_ary ( VALUE  self,
VALUE  ary 
)
static

Definition at line 2679 of file vm.c.

References core_hash_from_ary(), hash(), and REWIND_CFP.

Referenced by Init_VM().

◆ m_core_hash_merge_kwd()

static VALUE m_core_hash_merge_kwd ( int  argc,
VALUE argv,
VALUE  recv 
)
static

Definition at line 2738 of file vm.c.

References core_hash_merge_kwd(), hash(), and REWIND_CFP.

Referenced by Init_VM().

◆ m_core_hash_merge_ptr()

static VALUE m_core_hash_merge_ptr ( int  argc,
VALUE argv,
VALUE  recv 
)
static

Definition at line 2713 of file vm.c.

References core_hash_merge(), hash(), and REWIND_CFP.

Referenced by Init_VM().

◆ m_core_set_method_alias()

static VALUE m_core_set_method_alias ( VALUE  self,
VALUE  cbase,
VALUE  sym1,
VALUE  sym2 
)
static

Definition at line 2627 of file vm.c.

References Qnil, rb_alias(), REWIND_CFP, and SYM2ID.

Referenced by Init_VM().

◆ m_core_set_postexe()

static VALUE m_core_set_postexe ( VALUE  self)
static

◆ m_core_set_variable_alias()

static VALUE m_core_set_variable_alias ( VALUE  self,
VALUE  sym1,
VALUE  sym2 
)
static

Definition at line 2636 of file vm.c.

References Qnil, rb_alias_variable(), REWIND_CFP, and SYM2ID.

Referenced by Init_VM().

◆ m_core_undef_method()

static VALUE m_core_undef_method ( VALUE  self,
VALUE  cbase,
VALUE  sym 
)
static

Definition at line 2645 of file vm.c.

References Qnil, rb_clear_method_cache_by_class(), rb_undef(), REWIND_CFP, and SYM2ID.

Referenced by Init_VM().

◆ main_to_s()

static VALUE main_to_s ( VALUE  obj)
static

Definition at line 3145 of file vm.c.

References rb_str_new2.

Referenced by Init_top_self().

◆ make_localjump_error()

static VALUE make_localjump_error ( const char *  mesg,
VALUE  value,
int  reason 
)
static

◆ next_not_local_frame()

static rb_control_frame_t* next_not_local_frame ( rb_control_frame_t cfp)
static

Definition at line 1441 of file vm.c.

References rb_control_frame_struct::ep, RUBY_VM_PREVIOUS_CONTROL_FRAME, and VM_ENV_LOCAL_P().

Referenced by vm_iter_break().

◆ NORETURN()

NORETURN ( static void   vm_iter_breakrb_thread_t *th, VALUE val)

◆ nsdr()

static VALUE nsdr ( void  )
static

Definition at line 2776 of file vm.c.

References free(), rb_ary_new(), rb_ary_push(), rb_memerror(), and rb_str_new2.

Referenced by Init_VM().

◆ PUREFUNC() [1/3]

PUREFUNC ( static inline const VALUE VM_EP_LEPconst VALUE *)

Referenced by rb_vm_ep_local_ep(), and VM_CF_PREV_EP().

◆ PUREFUNC() [2/3]

PUREFUNC ( static inline const VALUE VM_CF_LEPconst rb_control_frame_t *const cfp)

◆ PUREFUNC() [3/3]

PUREFUNC ( static inline VALUE   VM_CF_BLOCK_HANDLERconst rb_control_frame_t *const cfp)

◆ rb_backref_get()

VALUE rb_backref_get ( void  )

◆ rb_backref_set()

void rb_backref_set ( VALUE  val)

◆ rb_binding_add_dynavars()

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

◆ rb_class_path_no_cache()

VALUE rb_class_path_no_cache ( VALUE  _klass)

◆ rb_fiber_mark_self()

void rb_fiber_mark_self ( rb_fiber_t fib)

◆ rb_frame_method_id_and_class()

int rb_frame_method_id_and_class ( ID idp,
VALUE klassp 
)

Definition at line 2047 of file vm.c.

References GET_THREAD, and rb_thread_method_id_and_class().

◆ rb_frame_pop()

void rb_frame_pop ( void  )

Definition at line 553 of file vm.c.

References ONLY_FOR_INTERNAL_USE.

◆ rb_insn_operand_intern()

VALUE rb_insn_operand_intern ( const rb_iseq_t iseq,
VALUE  insn,
int  op_no,
VALUE  op,
int  len,
size_t  pos,
VALUE pnop,
VALUE  child 
)

◆ rb_iseq_eval()

VALUE rb_iseq_eval ( const rb_iseq_t iseq)

Definition at line 2004 of file vm.c.

References GET_THREAD, rb_captured_block::val, vm_exec(), and vm_set_top_stack().

Referenced by iseqw_eval(), and rb_load_internal0().

◆ rb_iseq_eval_main()

VALUE rb_iseq_eval_main ( const rb_iseq_t iseq)

Definition at line 2014 of file vm.c.

References GET_THREAD, rb_captured_block::val, vm_exec(), and vm_set_main_stack().

Referenced by ruby_exec_internal().

◆ rb_iseq_local_variables()

VALUE rb_iseq_local_variables ( const rb_iseq_t iseq)

◆ rb_iter_break()

void rb_iter_break ( void  )

◆ rb_iter_break_value()

void rb_iter_break_value ( VALUE  val)

Definition at line 1474 of file vm.c.

References GET_THREAD, and vm_iter_break().

Referenced by argf_block_call_i().

◆ rb_lastline_get()

VALUE rb_lastline_get ( void  )

Definition at line 1219 of file vm.c.

References vm_svar_get(), and VM_SVAR_LASTLINE.

Referenced by Init_IO(), rb_io_print(), rb_reg_match2(), and uscore_get().

◆ rb_lastline_set()

void rb_lastline_set ( VALUE  val)

◆ rb_next_class_serial()

rb_serial_t rb_next_class_serial ( void  )

Definition at line 305 of file vm.c.

References NEXT_CLASS_SERIAL.

Referenced by class_alloc(), and rb_class_clear_method_cache().

◆ rb_obj_is_thread()

VALUE rb_obj_is_thread ( VALUE  obj)

Definition at line 2487 of file vm.c.

References Qfalse, Qtrue, rb_typeddata_is_kind_of(), and thread_data_type.

Referenced by rb_objspace_call_finalizer().

◆ rb_proc_create()

VALUE rb_proc_create ( VALUE  klass,
const struct rb_block block,
int8_t  safe_level,
int8_t  is_from_method,
int8_t  is_lambda 
)

◆ rb_proc_create_from_captured()

VALUE rb_proc_create_from_captured ( VALUE  klass,
const struct rb_captured_block captured,
enum rb_block_type  block_type,
int8_t  safe_level,
int8_t  is_from_method,
int8_t  is_lambda 
)

◆ rb_ruby_debug_ptr()

VALUE* rb_ruby_debug_ptr ( void  )

Definition at line 3185 of file vm.c.

References GET_VM, rb_captured_block::iseq, len, rb_insn_operand_intern(), and ruby_vm_debug_ptr().

◆ rb_ruby_verbose_ptr()

VALUE* rb_ruby_verbose_ptr ( void  )

Definition at line 3179 of file vm.c.

References GET_VM, and ruby_vm_verbose_ptr().

◆ rb_source_loc()

const char* rb_source_loc ( int *  pline)

◆ rb_source_location()

VALUE rb_source_location ( int *  pline)

◆ rb_sourcefile()

const char* rb_sourcefile ( void  )

◆ rb_sourcefilename()

VALUE rb_sourcefilename ( void  )

◆ rb_sourceline()

int rb_sourceline ( void  )

◆ rb_str_concat_literals()

VALUE rb_str_concat_literals ( size_t  ,
const VALUE  
)

◆ rb_thread_alloc()

VALUE rb_thread_alloc ( VALUE  klass)

Definition at line 2564 of file vm.c.

References ruby_thread_init(), and thread_alloc().

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

◆ rb_thread_current_status()

VALUE rb_thread_current_status ( const rb_thread_t th)

◆ rb_thread_mark()

void rb_thread_mark ( void *  ptr)

◆ rb_thread_method_id_and_class()

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

◆ rb_thread_recycle_stack_release()

void rb_thread_recycle_stack_release ( VALUE stack)

Definition at line 2336 of file vm.c.

References NULL, rb_fiber_mark_self(), RECYCLE_MAX, ruby_xfree(), and VM_ASSERT.

Referenced by thread_free(), and thread_start_func_2().

◆ rb_vm_add_root_module()

int rb_vm_add_root_module ( ID  id,
VALUE  module 
)

Definition at line 2153 of file vm.c.

References rb_vm_struct::defined_module_hash, GET_VM, ID2SYM, rb_hash_aset(), and TRUE.

Referenced by rb_define_class(), and rb_define_module().

◆ rb_vm_call_cfunc()

VALUE rb_vm_call_cfunc ( VALUE  recv,
VALUE(*)(VALUE func,
VALUE  arg,
VALUE  block_handler,
VALUE  filename 
)

◆ rb_vm_cbase()

VALUE rb_vm_cbase ( void  )

◆ rb_vm_check_redefinition_by_prepend()

void rb_vm_check_redefinition_by_prepend ( VALUE  klass)

◆ rb_vm_check_redefinition_opt_method()

static void rb_vm_check_redefinition_opt_method ( const rb_method_entry_t me,
VALUE  klass 
)
static

◆ rb_vm_control_frame_id_and_class()

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

◆ rb_vm_cref()

rb_cref_t* rb_vm_cref ( void  )

◆ rb_vm_cref_in_context()

const rb_cref_t* rb_vm_cref_in_context ( VALUE  self,
VALUE  cbase 
)

◆ rb_vm_cref_new_toplevel()

rb_cref_t* rb_vm_cref_new_toplevel ( void  )

Definition at line 253 of file vm.c.

References GET_THREAD, and vm_cref_new_toplevel().

Referenced by env_clone(), and localjump_reason().

◆ rb_vm_cref_replace_with_duplicated_cref()

rb_cref_t* rb_vm_cref_replace_with_duplicated_cref ( void  )

◆ rb_vm_env_local_variables()

VALUE rb_vm_env_local_variables ( const rb_env_t env)

◆ rb_vm_env_prev_env()

const rb_env_t* rb_vm_env_prev_env ( const rb_env_t env)

◆ rb_vm_ep_local_ep()

const VALUE* rb_vm_ep_local_ep ( const VALUE ep)

Definition at line 55 of file vm.c.

References PUREFUNC(), VM_CF_LEP(), and VM_EP_LEP().

Referenced by proc_new(), rb_vm_proc_local_ep(), and VM_STACK_ENV_WRITE().

◆ rb_vm_frame_block_handler()

VALUE rb_vm_frame_block_handler ( const rb_control_frame_t cfp)

◆ rb_vm_fstring_table()

st_table* rb_vm_fstring_table ( void  )

◆ rb_vm_get_binding_creatable_next_cfp()

rb_control_frame_t* rb_vm_get_binding_creatable_next_cfp ( const 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 ( const rb_thread_t th,
const rb_control_frame_t cfp 
)

◆ rb_vm_inc_const_missing_count()

void rb_vm_inc_const_missing_count ( void  )

Definition at line 323 of file vm.c.

References rb_class_path_no_cache().

Referenced by rb_const_missing().

◆ rb_vm_invoke_proc()

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

◆ rb_vm_jump_tag_but_local_jump()

void rb_vm_jump_tag_but_local_jump ( int  state)

◆ rb_vm_localjump_error()

void rb_vm_localjump_error ( const char *  mesg,
VALUE  value,
int  reason 
)

◆ rb_vm_make_binding()

VALUE rb_vm_make_binding ( rb_thread_t th,
const rb_control_frame_t src_cfp 
)

◆ rb_vm_make_jump_tag_but_local_jump()

VALUE rb_vm_make_jump_tag_but_local_jump ( int  state,
VALUE  val 
)

◆ rb_vm_make_proc()

VALUE rb_vm_make_proc ( rb_thread_t th,
const struct rb_captured_block captured,
VALUE  klass 
)

◆ rb_vm_make_proc_lambda()

VALUE rb_vm_make_proc_lambda ( rb_thread_t th,
const struct rb_captured_block captured,
VALUE  klass,
int8_t  is_lambda 
)

◆ rb_vm_mark()

void rb_vm_mark ( void *  ptr)

◆ rb_vm_pop_cfunc_frame()

void rb_vm_pop_cfunc_frame ( void  )

◆ rb_vm_register_special_exception()

void rb_vm_register_special_exception ( enum ruby_special_exceptions  sp,
VALUE  cls,
const char *  mesg 
)

◆ rb_vm_rewind_cfp()

void rb_vm_rewind_cfp ( rb_thread_t th,
rb_control_frame_t cfp 
)

◆ rb_vm_search_cf_from_ep()

static const rb_control_frame_t* rb_vm_search_cf_from_ep ( const rb_thread_t *const  th,
const rb_control_frame_t cfp,
const VALUE *const  ep 
)
inlinestatic

◆ rb_vm_set_progname()

void rb_vm_set_progname ( VALUE  filename)

◆ rb_vm_stack_to_heap()

void rb_vm_stack_to_heap ( rb_thread_t th)

◆ rb_vm_top_self()

VALUE rb_vm_top_self ( void  )

◆ rb_vm_trace_mark_event_hooks()

void rb_vm_trace_mark_event_hooks ( rb_hook_list_t hooks)

◆ ruby_th_dtrace_setup()

int ruby_th_dtrace_setup ( rb_thread_t th,
VALUE  klass,
ID  id,
struct ruby_dtrace_method_hook_args args 
)

◆ ruby_thread_init()

static VALUE ruby_thread_init ( VALUE  self)
static

◆ ruby_vm_at_exit()

void ruby_vm_at_exit ( void(*)(rb_vm_t *)  func)

Definition at line 561 of file vm.c.

References ALLOC, rb_vm_struct::at_exit, func, rb_at_exit_list::func, GET_VM, and rb_at_exit_list::next.

◆ ruby_vm_debug_ptr()

static VALUE* ruby_vm_debug_ptr ( rb_vm_t vm)
static

Definition at line 3173 of file vm.c.

References rb_vm_struct::debug.

Referenced by rb_ruby_debug_ptr().

◆ ruby_vm_destruct()

int ruby_vm_destruct ( rb_vm_t vm)

◆ ruby_vm_run_at_exit_hooks()

static void ruby_vm_run_at_exit_hooks ( rb_vm_t vm)
static

◆ ruby_vm_verbose_ptr()

static VALUE* ruby_vm_verbose_ptr ( rb_vm_t vm)
static

Definition at line 3167 of file vm.c.

References rb_vm_struct::verbose.

Referenced by rb_ruby_verbose_ptr().

◆ sdr()

static VALUE sdr ( void  )
static

Definition at line 2768 of file vm.c.

References NULL, Qnil, and rb_vm_bugreport().

Referenced by Init_VM().

◆ th_init()

static void th_init ( rb_thread_t th,
VALUE  self 
)
static

◆ thread_alloc()

static VALUE thread_alloc ( VALUE  klass)
static

Definition at line 2498 of file vm.c.

References thread_data_type, and TypedData_Make_Struct.

Referenced by rb_thread_alloc().

◆ thread_free()

static void thread_free ( void *  ptr)
static

◆ thread_memsize()

static size_t thread_memsize ( const void *  ptr)
static

◆ thread_recycle_stack()

static VALUE* thread_recycle_stack ( size_t  size)
static

Definition at line 2320 of file vm.c.

References ALLOC_N, and thread_recycle_stack_count.

Referenced by th_init().

◆ VM_BH_FROM_CFP_P()

static int VM_BH_FROM_CFP_P ( VALUE  block_handler,
const rb_control_frame_t cfp 
)
static

Definition at line 162 of file vm.c.

References VM_CFP_TO_CAPTURED_BLOCK(), and VM_TAGGED_PTR_REF.

Referenced by vm_call_iseq_setup_tailcall().

◆ vm_bind_update_env()

static void vm_bind_update_env ( rb_binding_t bind,
VALUE  envval 
)
static

◆ vm_block_handler_escape()

static void vm_block_handler_escape ( rb_thread_t th,
VALUE  block_handler,
VALUE procvalptr 
)
static

◆ VM_CAPTURED_BLOCK_TO_CFP()

static rb_control_frame_t* VM_CAPTURED_BLOCK_TO_CFP ( const struct rb_captured_block captured)
static

Definition at line 153 of file vm.c.

References GET_THREAD, VM_ASSERT, and VM_DEBUG_BP_CHECK.

Referenced by rb_vm_make_proc_lambda().

◆ VM_CF_BLOCK_HANDLER()

static VALUE VM_CF_BLOCK_HANDLER ( const rb_control_frame_t *const  cfp)
inlinestatic

◆ VM_CF_LEP()

static const VALUE* VM_CF_LEP ( const rb_control_frame_t *const  cfp)
inlinestatic

◆ VM_CF_PREV_EP()

static const VALUE* VM_CF_PREV_EP ( const rb_control_frame_t *const  cfp)
inlinestatic

◆ vm_cfp_svar_get()

static VALUE vm_cfp_svar_get ( rb_thread_t th,
rb_control_frame_t cfp,
VALUE  key 
)
static

Definition at line 1179 of file vm.c.

References lep_svar_get(), VM_CF_LEP(), and vm_normal_frame().

Referenced by vm_svar_get().

◆ vm_cfp_svar_set()

static void vm_cfp_svar_set ( rb_thread_t th,
rb_control_frame_t cfp,
VALUE  key,
const VALUE  val 
)
static

Definition at line 1186 of file vm.c.

References lep_svar_set(), VM_CF_LEP(), and vm_normal_frame().

Referenced by vm_svar_set().

◆ VM_CFP_TO_CAPTURED_BLOCK()

static struct rb_captured_block* VM_CFP_TO_CAPTURED_BLOCK ( const rb_control_frame_t cfp)
static

◆ vm_collect_local_variables_in_heap()

static int vm_collect_local_variables_in_heap ( rb_thread_t th,
const VALUE ep,
const struct local_var_list vars 
)
static

Definition at line 771 of file vm.c.

References collect_local_variables_in_env(), VM_ENV_ENVVAL_PTR(), and VM_ENV_ESCAPED_P().

◆ vm_cref_dump()

static void vm_cref_dump ( const char *  mesg,
const rb_cref_t cref 
)
static

Definition at line 259 of file vm.c.

References CREF_CLASS(), CREF_NEXT(), rb_class_path(), and RSTRING_PTR.

Referenced by method_definition_set().

◆ vm_cref_dup()

static rb_cref_t* vm_cref_dup ( const rb_cref_t cref)
static

◆ vm_cref_new()

static rb_cref_t* vm_cref_new ( VALUE  klass,
rb_method_visibility_t  visi,
int  module_func,
rb_cref_t prev_cref,
int  pushed_by_eval 
)
static

Definition at line 211 of file vm.c.

References FALSE, and vm_cref_new0().

Referenced by Init_VM(), vm_cref_dup(), vm_cref_new_toplevel(), and vm_cref_push().

◆ vm_cref_new0()

static rb_cref_t* vm_cref_new0 ( VALUE  klass,
rb_method_visibility_t  visi,
int  module_func,
rb_cref_t prev_cref,
int  pushed_by_eval,
int  use_prev_prev 
)
static

◆ vm_cref_new_toplevel()

static rb_cref_t* vm_cref_new_toplevel ( rb_thread_t th)
static

◆ vm_cref_new_use_prev()

static rb_cref_t* vm_cref_new_use_prev ( VALUE  klass,
rb_method_visibility_t  visi,
int  module_func,
rb_cref_t prev_cref,
int  pushed_by_eval 
)
static

Definition at line 217 of file vm.c.

References TRUE, and vm_cref_new0().

Referenced by rb_vm_rewrite_cref().

◆ vm_default_params()

static VALUE vm_default_params ( void  )
static

Definition at line 2227 of file vm.c.

References GET_VM, rb_hash_new(), rb_obj_freeze(), result, and SET.

Referenced by Init_VM().

◆ vm_default_params_setup()

static void vm_default_params_setup ( rb_vm_t vm)
static

◆ vm_define_method()

static void vm_define_method ( rb_thread_t th,
VALUE  obj,
ID  id,
VALUE  iseqval,
int  is_singleton 
)
static

◆ VM_EP_LEP()

static const VALUE* VM_EP_LEP ( const VALUE ep)
inlinestatic

Definition at line 26 of file vm.c.

References VM_ENV_LOCAL_P(), and VM_ENV_PREV_EP().

Referenced by rb_vm_ep_local_ep(), VM_CF_LEP(), and vm_throw_start().

◆ vm_exec()

static VALUE vm_exec ( rb_thread_t th)
static

◆ vm_get_ruby_level_caller_cfp()

static rb_control_frame_t* vm_get_ruby_level_caller_cfp ( const rb_thread_t th,
const rb_control_frame_t cfp 
)
static

◆ vm_init2()

static void vm_init2 ( rb_vm_t vm)
static

◆ vm_init_redefined_flag()

static void vm_init_redefined_flag ( void  )
static

◆ vm_invoke_bmethod()

static VALUE vm_invoke_bmethod ( rb_thread_t th,
rb_proc_t proc,
VALUE  self,
int  argc,
const VALUE argv,
VALUE  block_handler 
)
static

◆ vm_invoke_proc()

static VALUE vm_invoke_proc ( rb_thread_t th,
rb_proc_t proc,
VALUE  self,
int  argc,
const VALUE argv,
VALUE  block_handler 
)
static

◆ vm_iter_break()

static void vm_iter_break ( rb_thread_t th,
VALUE  val 
)
static

◆ vm_make_env_each()

static VALUE vm_make_env_each ( rb_thread_t *const  th,
rb_control_frame_t *const  cfp 
)
static

◆ vm_make_env_object()

static VALUE vm_make_env_object ( rb_thread_t th,
rb_control_frame_t cfp 
)
static

◆ vm_memsize()

static size_t vm_memsize ( const void *  ptr)
static

◆ vm_normal_frame()

static rb_control_frame_t* vm_normal_frame ( rb_thread_t th,
rb_control_frame_t cfp 
)
static

◆ vm_passed_block_handler()

static VALUE vm_passed_block_handler ( rb_thread_t th)
static

◆ vm_redefinition_check_flag()

static int vm_redefinition_check_flag ( VALUE  klass)
static

◆ vm_set_eval_stack()

static void vm_set_eval_stack ( rb_thread_t th,
const rb_iseq_t iseq,
const rb_cref_t cref,
const struct rb_block base_block 
)
static

◆ vm_set_main_stack()

static void vm_set_main_stack ( rb_thread_t th,
const rb_iseq_t iseq 
)
static

◆ vm_set_top_stack()

static void vm_set_top_stack ( rb_thread_t th,
const rb_iseq_t iseq 
)
static

◆ vm_stat()

static VALUE vm_stat ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ vm_svar_get()

static VALUE vm_svar_get ( VALUE  key)
static

Definition at line 1193 of file vm.c.

References rb_thread_struct::cfp, GET_THREAD, and vm_cfp_svar_get().

Referenced by rb_backref_get(), and rb_lastline_get().

◆ vm_svar_set()

static void vm_svar_set ( VALUE  key,
VALUE  val 
)
static

Definition at line 1200 of file vm.c.

References rb_thread_struct::cfp, GET_THREAD, and vm_cfp_svar_set().

Referenced by rb_backref_set(), and rb_lastline_set().

◆ vm_yield()

static VALUE vm_yield ( rb_thread_t th,
int  argc,
const VALUE argv 
)
static

◆ vm_yield_lambda_splattable()

static VALUE vm_yield_lambda_splattable ( rb_thread_t th,
VALUE  args 
)
static

◆ vm_yield_with_block()

static VALUE vm_yield_with_block ( rb_thread_t th,
int  argc,
const VALUE argv,
VALUE  block_handler 
)
static

Definition at line 1084 of file vm.c.

References check_block_handler(), FALSE, invoke_block_from_c_splattable(), and NULL.

◆ vm_yield_with_cref()

static VALUE vm_yield_with_cref ( rb_thread_t th,
int  argc,
const VALUE argv,
const rb_cref_t cref,
int  is_lambda 
)
static

Variable Documentation

◆ rb_cRubyVM

VALUE rb_cRubyVM

Definition at line 310 of file vm.c.

Referenced by Init_ISeq().

◆ rb_cThread

VALUE rb_cThread

Definition at line 311 of file vm.c.

◆ rb_fstring_hash_type

const struct st_hash_type rb_fstring_hash_type

Definition at line 253 of file string.c.

◆ rb_gc_stack_maxsize

size_t rb_gc_stack_maxsize

Referenced by core_hash_merge_kwd().

◆ rb_gc_stack_start

VALUE* rb_gc_stack_start

Referenced by core_hash_merge_kwd().

◆ rb_mRubyVMFrozenCore

VALUE rb_mRubyVMFrozenCore

Definition at line 312 of file vm.c.

Referenced by mlambda(), mproc(), and rb_threadptr_exec_event_hooks_orig().

◆ ruby_current_thread

rb_thread_t* ruby_current_thread = 0

Definition at line 316 of file vm.c.

◆ ruby_current_vm

rb_vm_t* ruby_current_vm = 0

Definition at line 317 of file vm.c.

Referenced by Init_VM().

◆ ruby_threadptr_data_type

const rb_data_type_t ruby_threadptr_data_type
Initial value:
= {
"VM/thread",
{
},
}
static void thread_free(void *ptr)
Definition: vm.c:2416
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static size_t thread_memsize(const void *ptr)
Definition: vm.c:2461
void rb_thread_mark(void *ptr)
Definition: vm.c:2352

Definition at line 2476 of file vm.c.

◆ ruby_vm_class_serial

rb_serial_t ruby_vm_class_serial = 1
static

Definition at line 292 of file vm.c.

◆ ruby_vm_collect_usage_func_insn

void(* ruby_vm_collect_usage_func_insn) (int insn) = NULL

Definition at line 3366 of file vm.c.

Referenced by rb_vm_fstring_table().

◆ ruby_vm_collect_usage_func_operand

void(* ruby_vm_collect_usage_func_operand) (int insn, int n, VALUE op) = NULL

Definition at line 3367 of file vm.c.

Referenced by rb_vm_fstring_table().

◆ ruby_vm_collect_usage_func_register

void(* ruby_vm_collect_usage_func_register) (int reg, int isset) = NULL

Definition at line 3368 of file vm.c.

Referenced by rb_vm_fstring_table().

◆ ruby_vm_const_missing_count

VALUE ruby_vm_const_missing_count = 0

Definition at line 315 of file vm.c.

◆ ruby_vm_event_flags

rb_event_flag_t ruby_vm_event_flags

Definition at line 318 of file vm.c.

Referenced by recalc_add_ruby_vm_event_flags(), and recalc_remove_ruby_vm_event_flags().

◆ ruby_vm_global_constant_state

rb_serial_t ruby_vm_global_constant_state = 1
static

Definition at line 291 of file vm.c.

◆ ruby_vm_global_method_state

rb_serial_t ruby_vm_global_method_state = 1
static

Definition at line 290 of file vm.c.

◆ thread_recycle_stack_count

int thread_recycle_stack_count = 0
static

Definition at line 2317 of file vm.c.

Referenced by thread_recycle_stack().

◆ thread_recycle_stack_slot

VALUE* thread_recycle_stack_slot[RECYCLE_MAX]
static

Definition at line 2316 of file vm.c.

◆ vm_data_type

const rb_data_type_t vm_data_type
static
Initial value:
= {
"VM",
}
static size_t vm_memsize(const void *ptr)
Definition: vm.c:2206
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
#define NULL
Definition: _sdbm.c:102

Definition at line 2219 of file vm.c.

◆ vm_opt_method_table

st_table* vm_opt_method_table = 0
static

Definition at line 1481 of file vm.c.