Ruby
2.4.2p198(2017-09-14revision59899)
|
#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"
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) |
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_t * | ruby_current_thread = 0 |
rb_vm_t * | ruby_current_vm = 0 |
rb_event_flag_t | ruby_vm_event_flags |
static st_table * | vm_opt_method_table = 0 |
static const rb_data_type_t | vm_data_type |
static VALUE * | thread_recycle_stack_slot [RECYCLE_MAX] |
static int | thread_recycle_stack_count = 0 |
const rb_data_type_t | ruby_threadptr_data_type |
VALUE * | rb_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 |
#define C | ( | k | ) | add_opt_method(rb_c##k, mid, bop) |
Referenced by frame_return_value(), and vm_init_redefined_flag().
#define OP | ( | mid_, | |
bop_ | |||
) | (mid = id##mid_, bop = BOP_##bop_, ruby_vm_redefined_flag[bop] = 0) |
Referenced by vm_init_redefined_flag().
#define PROCDEBUG 0 |
Definition at line 302 of file vm.c.
Referenced by vm_make_env_object().
#define RECYCLE_MAX 64 |
Definition at line 2315 of file vm.c.
Referenced by rb_thread_recycle_stack_release().
#define REWIND_CFP | ( | expr | ) |
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().
#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().
#define S | ( | s | ) | sym_##s = ID2SYM(rb_intern_const(#s)) |
Referenced by vm_stat().
#define SET | ( | name, | |
attr | |||
) |
Referenced by vm_default_params(), and vm_stat().
#define SET | ( | name | ) | rb_hash_aset(result, ID2SYM(rb_intern(#name)), SIZET2NUM(vm->default_params.name)); |
#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().
Definition at line 1536 of file vm.c.
References rb_method_entry_struct::def, rb_bug(), rb_id2name(), rb_method_entry_at(), st_data_t, st_insert, rb_method_definition_struct::type, and VM_METHOD_TYPE_CFUNC.
|
inlinestatic |
Definition at line 1056 of file vm.c.
References rb_thread_struct::cfp, Qnil, rb_vm_localjump_error(), UNLIKELY, VM_ASSERT, VM_BLOCK_HANDLER_NONE, vm_block_handler_verify(), and VM_CF_BLOCK_HANDLER().
Referenced by vm_yield(), vm_yield_lambda_splattable(), vm_yield_with_block(), and vm_yield_with_cref().
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().
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().
|
static |
|
static |
Definition at line 1517 of file vm.c.
References ID_TABLE_CONTINUE, rb_method_entry_struct::owner, rb_method_entry(), and rb_vm_check_redefinition_opt_method().
Referenced by rb_vm_check_redefinition_by_prepend().
|
static |
Definition at line 763 of file vm.c.
References collect_local_variables_in_iseq(), rb_env_t::iseq, NULL, and rb_vm_env_prev_env().
Referenced by rb_vm_env_local_variables(), and vm_collect_local_variables_in_heap().
|
static |
Definition at line 752 of file vm.c.
References rb_iseq_struct::body, rb_iseq_constant_body::local_table, rb_iseq_constant_body::local_table_size, and local_var_list_add().
Referenced by collect_local_variables_in_env(), and rb_iseq_local_variables().
Definition at line 2687 of file vm.c.
References Check_Type, core_hash_merge_ary(), hash(), RARRAY_LEN, rb_hash_new(), REWIND_CFP, RUBY_DTRACE_CREATE_HOOK, and T_ARRAY.
Referenced by m_core_hash_from_ary(), and m_core_set_postexe().
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().
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().
Definition at line 2746 of file vm.c.
References hash(), kwcheck_i(), kwmerge_i(), rb_check_arity, rb_convert_type(), rb_gc_stack_maxsize, rb_gc_stack_start, rb_hash_foreach(), and T_HASH.
Referenced by m_core_hash_merge_kwd(), and m_core_set_postexe().
|
static |
Definition at line 1609 of file vm.c.
References C, FALSE, Qnil, TAG_BREAK, THROW_DATA_CONSUMED_P(), THROW_DATA_P, THROW_DATA_STATE(), THROW_DATA_VAL(), and VM_FRAME_TYPE().
Referenced by hook_before_rewind().
Definition at line 2163 of file vm.c.
References ST_DELETE, and xfree().
Referenced by ruby_vm_destruct().
|
static |
Definition at line 2242 of file vm.c.
References getenv, PRIuSIZE, result, and RUBY_VM_SIZE_ALIGN.
Referenced by vm_default_params_setup().
|
static |
Definition at line 1645 of file vm.c.
References rb_callable_method_entry_struct::called_id, rb_thread_struct::cfp, rb_callable_method_entry_struct::def, EXEC_EVENT_HOOK, EXEC_EVENT_HOOK_AND_POP_FRAME, frame_return_value(), rb_method_definition_struct::original_id, rb_callable_method_entry_struct::owner, Qnil, rb_eSysStackError, rb_vm_frame_method_entry(), RBASIC_CLASS, RUBY_DTRACE_METHOD_RETURN_HOOK, RUBY_EVENT_B_RETURN, RUBY_EVENT_END, RUBY_EVENT_RETURN, rb_control_frame_struct::self, TAG_RAISE, THROW_DATA_CONSUMED_SET(), VM_FRAME_BMETHOD_P(), VM_FRAME_MAGIC_BLOCK, VM_FRAME_MAGIC_CLASS, VM_FRAME_MAGIC_LAMBDA, VM_FRAME_MAGIC_METHOD, and VM_FRAME_TYPE().
Referenced by vm_exec().
void Init_BareVM | ( | void | ) |
Definition at line 3107 of file vm.c.
References EXIT_FAILURE, Init_native_thread(), MEMZERO, rb_vm_struct::objspace, rb_objspace_alloc(), rb_thread_set_current_raw, ruby_mimmalloc(), ruby_thread_init_stack(), th_init(), rb_thread_struct::vm, and vm_init2().
Referenced by ruby_setup().
void Init_top_self | ( | void | ) |
Definition at line 3157 of file vm.c.
References GET_VM, main_to_s(), rb_cObject, rb_define_alias(), rb_define_singleton_method(), rb_obj_alloc(), rb_singleton_class(), rb_vm_top_self(), and rb_vm_struct::top_self.
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().
void Init_vm_objects | ( | void | ) |
Definition at line 3130 of file vm.c.
References rb_vm_struct::defined_module_hash, rb_vm_struct::frozen_strings, GET_VM, rb_vm_struct::loading_table, rb_vm_struct::mark_object_ary, rb_ary_tmp_new(), rb_hash_new(), st_init_strtable, and st_init_table_with_size.
Referenced by ruby_setup().
|
inlinestatic |
Definition at line 963 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, rb_captured_block::ep, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::local_table_size, rb_iseq_constant_body::param, rb_iseq_constant_body::size, rb_control_frame_struct::sp, rb_iseq_constant_body::stack_max, vm_exec(), VM_FRAME_FLAG_FINISH, VM_GUARDED_PREV_EP, and vm_push_frame().
Referenced by invoke_iseq_block_from_c().
|
inlinestatic |
Definition at line 1026 of file vm.c.
References block_handler_type_ifunc, block_handler_type_iseq, block_handler_type_proc, block_handler_type_symbol, block_proc_is_lambda(), invoke_iseq_block_from_c(), Qundef, rb_captured_block::self, VM_BH_TO_IFUNC_BLOCK(), VM_BH_TO_ISEQ_BLOCK(), VM_BH_TO_PROC(), VM_BH_TO_SYMBOL(), vm_block_handler_type(), vm_proc_to_block_handler(), VM_UNREACHABLE, vm_yield_with_cfunc(), and vm_yield_with_symbol().
Referenced by vm_yield(), vm_yield_lambda_splattable(), vm_yield_with_block(), and vm_yield_with_cref().
|
inlinestatic |
Definition at line 1098 of file vm.c.
References rb_block::as, block_proc_is_lambda(), block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_block::captured, FALSE, invoke_iseq_block_from_c(), NULL, rb_block::proc, Qundef, rb_block::symbol, vm_block_type(), vm_proc_block(), VM_UNREACHABLE, vm_yield_with_cfunc(), and vm_yield_with_symbol().
Referenced by vm_invoke_bmethod(), and vm_invoke_proc().
|
static |
Definition at line 977 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, rb_captured_block::ep, EXEC_EVENT_HOOK, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::local_table_size, rb_iseq_constant_body::param, Qnil, RUBY_DTRACE_METHOD_ENTRY_HOOK, RUBY_DTRACE_METHOD_RETURN_HOOK, RUBY_EVENT_CALL, RUBY_EVENT_RETURN, rb_iseq_constant_body::size, rb_control_frame_struct::sp, rb_iseq_constant_body::stack_max, vm_exec(), VM_FRAME_FLAG_BMETHOD, VM_FRAME_FLAG_FINISH, VM_GUARDED_PREV_EP, and vm_push_frame().
Referenced by invoke_iseq_block_from_c().
|
inlinestatic |
Definition at line 999 of file vm.c.
References arg_setup_block, arg_setup_lambda, arg_setup_method, argc, rb_thread_struct::cfp, rb_captured_block::code, invoke_block(), invoke_bmethod(), rb_captured_block::iseq, NULL, rb_thread_struct::passed_bmethod_me, rb_iseq_check(), rb_control_frame_struct::sp, rb_block::type, VM_FRAME_MAGIC_BLOCK, VM_FRAME_MAGIC_LAMBDA, and vm_yield_setup_args().
Referenced by invoke_block_from_c_splattable(), and invoke_block_from_c_unsplattable().
Definition at line 2731 of file vm.c.
References Check_Type, ST_CONTINUE, and T_SYMBOL.
Referenced by core_hash_merge_kwd().
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().
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().
|
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().
Definition at line 2679 of file vm.c.
References core_hash_from_ary(), hash(), and REWIND_CFP.
Referenced by Init_VM().
Definition at line 2738 of file vm.c.
References core_hash_merge_kwd(), hash(), and REWIND_CFP.
Referenced by Init_VM().
Definition at line 2713 of file vm.c.
References core_hash_merge(), hash(), and REWIND_CFP.
Referenced by Init_VM().
Definition at line 2627 of file vm.c.
References Qnil, rb_alias(), REWIND_CFP, and SYM2ID.
Referenced by Init_VM().
Definition at line 2655 of file vm.c.
References core_hash_from_ary(), core_hash_merge_ary(), core_hash_merge_kwd(), hash(), Qnil, rb_block_proc(), rb_call_end_proc(), and rb_set_end_proc().
Referenced by Init_VM().
Definition at line 2636 of file vm.c.
References Qnil, rb_alias_variable(), REWIND_CFP, and SYM2ID.
Referenced by Init_VM().
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().
Definition at line 1360 of file vm.c.
References CONST_ID, id, ID2SYM, rb_eLocalJumpError, rb_exc_new2, rb_iv_set(), TAG_BREAK, TAG_NEXT, TAG_REDO, TAG_RETRY, and TAG_RETURN.
Referenced by rb_vm_localjump_error(), and rb_vm_make_jump_tag_but_local_jump().
|
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 | ( | static void | vm_iter_breakrb_thread_t *th, VALUE val | ) |
Referenced by rb_vm_jump_tag_but_local_jump().
|
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().
Referenced by rb_vm_ep_local_ep(), and VM_CF_PREV_EP().
PUREFUNC | ( | static inline VALUE | VM_CF_BLOCK_HANDLERconst rb_control_frame_t *const cfp | ) |
VALUE rb_backref_get | ( | void | ) |
Definition at line 1207 of file vm.c.
References VM_SVAR_BACKREF, and vm_svar_get().
Referenced by date__httpdate(), date__iso8601(), date__jisx0301(), date__parse(), date__rfc2822(), date__rfc3339(), date__strptime_internal(), date__xmlschema(), last_match_getter(), last_paren_match_getter(), match_getter(), nucomp_s_convert(), nurat_s_convert(), postmatch_getter(), prematch_getter(), rb_backref_set_string(), rb_f_global_variables(), rb_pat_search(), rb_reg_match_m(), rb_reg_s_last_match(), rb_reg_search0(), rb_str_rpartition(), rb_str_split_m(), rb_str_sub_bang(), rb_str_subpat(), rb_str_subpat_set(), scan_once(), and str_gsub().
void rb_backref_set | ( | VALUE | val | ) |
Definition at line 1213 of file vm.c.
References VM_SVAR_BACKREF, and vm_svar_set().
Referenced by date__httpdate(), date__iso8601(), date__jisx0301(), date__parse(), date__rfc2822(), date__rfc3339(), date__strptime_internal(), date__xmlschema(), match_setter(), nucomp_s_convert(), nurat_s_convert(), rb_backref_set_string(), rb_pat_search(), rb_reg_eqq(), rb_reg_match2(), rb_reg_match_m(), rb_reg_search0(), rb_str_index_m(), rb_str_rindex_m(), and reg_match_pos().
const VALUE* rb_binding_add_dynavars | ( | rb_binding_t * | bind, |
int | dyncount, | ||
const ID * | dynvars | ||
) |
Definition at line 920 of file vm.c.
References ALLOCV_END, ALLOCV_N, rb_binding_t::block, rb_iseq_struct::body, rb_thread_struct::cfp, env, rb_env_t::env, GET_THREAD, rb_captured_block::iseq, rb_iseq_location_struct::label, rb_iseq_constant_body::location, MEMCPY, NEW_NODE, NODE_SCOPE, NULL, numberof, rb_binding_t::path, rb_fstring_cstr(), rb_iseq_new(), rb_iseq_new_top(), rb_vm_pop_frame(), RNode::tbl, RNode::u1, vm_bind_update_env(), vm_block_iseq(), vm_make_env_object(), and vm_set_eval_stack().
Referenced by bind_local_variable_set().
Definition at line 309 of file variable.c.
References NIL_P, null_cache(), fc_result::path, rb_str_dup(), and rb_tmp_class_path().
Referenced by rb_vm_inc_const_missing_count(), and ruby_th_dtrace_setup().
void rb_fiber_mark_self | ( | rb_fiber_t * | fib | ) |
Definition at line 301 of file cont.c.
References rb_fiber_struct::cont, rb_gc_mark(), and rb_context_struct::self.
Referenced by fiber_mark(), rb_thread_mark(), and rb_thread_recycle_stack_release().
Definition at line 2047 of file vm.c.
References GET_THREAD, and rb_thread_method_id_and_class().
void rb_frame_pop | ( | void | ) |
Definition at line 553 of file vm.c.
References ONLY_FOR_INTERNAL_USE.
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 | ||
) |
Referenced by rb_ruby_debug_ptr(), and rb_vm_fstring_table().
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().
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().
Definition at line 792 of file vm.c.
References rb_iseq_struct::body, collect_local_variables_in_iseq(), local_var_list_finish(), local_var_list_init(), and rb_iseq_constant_body::parent_iseq.
Referenced by rb_iseqw_local_variables().
void rb_iter_break | ( | void | ) |
Definition at line 1468 of file vm.c.
References GET_THREAD, Qnil, and vm_iter_break().
Referenced by DEFINE_ENUMFUNCS(), find_i(), find_index_i(), find_index_iter_i(), first_i(), lazy_init_iterator(), lazy_init_yielder(), lexer_i(), member_i(), take_i(), and take_while_i().
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().
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().
void rb_lastline_set | ( | VALUE | val | ) |
Definition at line 1225 of file vm.c.
References VM_SVAR_LASTLINE, and vm_svar_set().
Referenced by argf_gets(), Init_IO(), io_s_foreach(), rb_f_chomp(), rb_f_chop(), rb_f_gsub(), rb_f_sub(), rb_gets(), rb_gzreader_gets(), rb_io_gets_m(), and strio_gets().
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().
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().
VALUE rb_proc_create | ( | VALUE | klass, |
const struct rb_block * | block, | ||
int8_t | safe_level, | ||
int8_t | is_from_method, | ||
int8_t | is_lambda | ||
) |
Definition at line 830 of file vm.c.
References rb_block::as, rb_proc_t::block, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_block::captured, rb_captured_block::code, rb_captured_block::ep, GET_THREAD, rb_proc_t::is_from_method, rb_proc_t::is_lambda, rb_block::proc, Qundef, RB_OBJ_WRITE, RB_OBJ_WRITTEN, rb_proc_alloc(), RTYPEDDATA_DATA, rb_proc_t::safe_level, rb_captured_block::self, rb_block::symbol, rb_block::type, rb_captured_block::val, VM_ASSERT, vm_block_ep(), vm_block_type(), vm_block_type_set(), and VM_ENV_ENVVAL().
Referenced by proc_dup(), and rb_obj_is_proc().
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 | ||
) |
Definition at line 805 of file vm.c.
References rb_block::as, rb_proc_t::block, rb_block::captured, rb_captured_block::code, rb_captured_block::ep, GET_THREAD, rb_proc_t::is_from_method, rb_proc_t::is_lambda, Qundef, RB_OBJ_WRITE, RB_OBJ_WRITTEN, rb_proc_alloc(), RTYPEDDATA_DATA, rb_proc_t::safe_level, rb_captured_block::self, rb_captured_block::val, VM_ASSERT, vm_block_type_set(), and VM_ENV_ENVVAL().
Referenced by rb_vm_make_proc_lambda().
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().
VALUE* rb_ruby_verbose_ptr | ( | void | ) |
Definition at line 3179 of file vm.c.
References GET_VM, and ruby_vm_verbose_ptr().
const char* rb_source_loc | ( | int * | pline | ) |
Definition at line 1291 of file vm.c.
References rb_source_location(), and RSTRING_PTR.
Referenced by call_trace_func(), newobj_init(), rb_bug(), rb_bug_context(), ruby_th_dtrace_setup(), and setup_exception().
VALUE rb_source_location | ( | int * | pline | ) |
Definition at line 1275 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, GET_THREAD, rb_control_frame_struct::iseq, rb_iseq_constant_body::location, rb_iseq_location_struct::path, rb_vm_get_ruby_level_next_cfp(), and rb_vm_get_sourceline().
Referenced by error_pos_str(), eval_string_with_cref(), rb_source_loc(), setup_const_entry(), and warning_string().
const char* rb_sourcefile | ( | void | ) |
Definition at line 1247 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, GET_THREAD, rb_control_frame_struct::iseq, rb_iseq_constant_body::location, rb_iseq_location_struct::path, rb_vm_get_ruby_level_next_cfp(), and RSTRING_PTR.
Referenced by rb_autoload_load().
VALUE rb_sourcefilename | ( | void | ) |
Definition at line 1233 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, GET_THREAD, rb_control_frame_struct::iseq, rb_iseq_constant_body::location, rb_iseq_location_struct::path, Qnil, and rb_vm_get_ruby_level_next_cfp().
int rb_sourceline | ( | void | ) |
Definition at line 1261 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD, rb_vm_get_ruby_level_next_cfp(), and rb_vm_get_sourceline().
Referenced by update_coverage().
Definition at line 2825 of file string.c.
References ENC_CODERANGE, ENCINDEX_US_ASCII, ENCODING_GET, ENCODING_GET_INLINED, NULL, OBJ_INFECT_RAW, rb_enc_set_index(), rb_str_new(), rb_str_resurrect(), RSTRING_LEN, and RSTRING_PTR.
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().
VALUE rb_thread_current_status | ( | const rb_thread_t * | th | ) |
Definition at line 2053 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, rb_callable_method_entry_struct::def, rb_captured_block::iseq, rb_control_frame_struct::iseq, rb_iseq_location_struct::label, rb_iseq_constant_body::location, rb_method_definition_struct::original_id, rb_callable_method_entry_struct::owner, rb_iseq_location_struct::path, rb_control_frame_struct::pc, PRIsVALUE, Qnil, rb_class_path(), rb_id2str, rb_sprintf(), rb_vm_frame_method_entry(), and rb_vm_get_sourceline().
void rb_thread_mark | ( | void * | ptr | ) |
Definition at line 2352 of file vm.c.
References rb_control_frame_struct::block_code, rb_thread_struct::cfp, rb_control_frame_struct::ep, rb_thread_struct::errinfo, rb_thread_struct::event_hooks, rb_thread_struct::fiber, rb_thread_struct::first_args, rb_thread_struct::first_proc, GET_THREAD, rb_control_frame_struct::iseq, rb_thread_struct::last_status, rb_thread_struct::local_storage, rb_thread_struct::local_storage_recursive_hash, rb_thread_struct::local_storage_recursive_hash_for_trace, rb_thread_struct::locking_mutex, rb_thread_struct::machine, rb_thread_struct::name, rb_thread_struct::pending_interrupt_mask_stack, rb_thread_struct::pending_interrupt_queue, rb_fiber_mark_self(), rb_gc_mark(), rb_gc_mark_locations(), rb_gc_mark_machine_stack(), rb_gc_mark_values(), rb_mark_tbl(), rb_vm_trace_mark_event_hooks(), rb_thread_struct::regs, rb_thread_struct::root_fiber, rb_thread_struct::root_svar, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_UNLESS_NULL, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_control_frame_struct::self, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_end, rb_thread_struct::stack_size, rb_thread_struct::stack_start, rb_thread_struct::stat_insn_usage, rb_thread_struct::thgroup, rb_thread_struct::top_self, rb_thread_struct::top_wrapper, rb_thread_struct::value, VM_ASSERT, VM_ENV_FLAG_ESCAPED, and VM_ENV_FLAGS().
Referenced by cont_mark().
int rb_thread_method_id_and_class | ( | rb_thread_t * | th, |
ID * | idp, | ||
ID * | called_idp, | ||
VALUE * | klassp | ||
) |
Definition at line 2041 of file vm.c.
References rb_thread_struct::cfp, and rb_vm_control_frame_id_and_class().
Referenced by call_trace_func(), rb_frame_method_id_and_class(), and ruby_th_dtrace_setup().
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().
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().
VALUE rb_vm_call_cfunc | ( | VALUE | recv, |
VALUE(*)(VALUE) | func, | ||
VALUE | arg, | ||
VALUE | block_handler, | ||
VALUE | filename | ||
) |
Definition at line 2077 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD, rb_captured_block::iseq, Qnil, rb_iseq_new(), rb_vm_pop_frame(), rb_vm_trace_mark_event_hooks(), rb_control_frame_struct::sp, rb_captured_block::val, vm_cref_new_toplevel(), VM_ENV_FLAG_LOCAL, VM_FRAME_FLAG_FINISH, VM_FRAME_MAGIC_TOP, and vm_push_frame().
Referenced by rb_require_internal().
VALUE rb_vm_cbase | ( | void | ) |
Definition at line 1346 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD, rb_eRuntimeError, rb_raise(), rb_vm_get_ruby_level_next_cfp(), and vm_get_cbase().
Referenced by rb_f_autoload(), and rb_f_autoload_p().
void rb_vm_check_redefinition_by_prepend | ( | VALUE | klass | ) |
Definition at line 1529 of file vm.c.
References check_redefined_method(), rb_id_table_foreach(), RCLASS_M_TBL, RCLASS_ORIGIN, and vm_redefinition_check_flag().
Referenced by rb_prepend_module().
|
static |
Definition at line 1501 of file vm.c.
References rb_method_entry_struct::def, FL_TEST, RB_TYPE_P, RBASIC_CLASS, RICLASS_IS_ORIGIN, ruby_vm_redefined_flag, st_data_t, st_lookup, T_ICLASS, rb_method_definition_struct::type, VM_METHOD_TYPE_CFUNC, and vm_redefinition_check_flag().
Referenced by check_redefined_method().
int rb_vm_control_frame_id_and_class | ( | const rb_control_frame_t * | cfp, |
ID * | idp, | ||
ID * | called_idp, | ||
VALUE * | klassp | ||
) |
Definition at line 2025 of file vm.c.
References rb_callable_method_entry_struct::called_id, rb_callable_method_entry_struct::def, FALSE, rb_method_definition_struct::original_id, rb_callable_method_entry_struct::owner, rb_vm_frame_method_entry(), and TRUE.
Referenced by fill_id_and_klass(), get_klass(), and rb_thread_method_id_and_class().
rb_cref_t* rb_vm_cref | ( | void | ) |
Definition at line 1299 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD, NULL, rb_vm_get_cref(), and rb_vm_get_ruby_level_next_cfp().
Referenced by method_entry_resolve_refinement(), rb_mod_nesting(), rb_mod_s_constants(), rb_mod_s_used_modules(), rb_scope_module_func_check(), rb_scope_visibility_get(), top_using(), vm_cref_set_visibility(), and vm_define_method().
Definition at line 1321 of file vm.c.
References rb_thread_struct::cfp, CREF_CLASS(), CREF_NEXT(), dp, rb_control_frame_struct::ep, GET_THREAD, NULL, rb_vm_get_cref(), rb_vm_get_ruby_level_next_cfp(), rb_control_frame_struct::self, and vm_env_cref_by_cref().
Referenced by rb_mod_define_method().
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_cref_t* rb_vm_cref_replace_with_duplicated_cref | ( | void | ) |
Definition at line 1312 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD, rb_vm_get_ruby_level_next_cfp(), and vm_cref_replace_with_duplicated_cref().
Referenced by mod_using(), and top_using().
Definition at line 783 of file vm.c.
References collect_local_variables_in_env(), local_var_list_finish(), and local_var_list_init().
Referenced by bind_local_variables().
Definition at line 739 of file vm.c.
References rb_env_t::ep, NULL, VM_ENV_ENVVAL_PTR(), VM_ENV_LOCAL_P(), and VM_ENV_PREV_EP().
Referenced by check_env(), collect_local_variables_in_env(), gc_mark_imemo(), get_local_variable_ptr(), and rb_vmdebug_env_dump_raw().
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().
VALUE rb_vm_frame_block_handler | ( | const rb_control_frame_t * | cfp | ) |
Definition at line 82 of file vm.c.
References rb_thread_struct::cfp, env, rb_env_t::ep, FALSE, GET_THREAD, NULL, Qundef, rb_thread_struct::stack, rb_thread_struct::stack_size, TRUE, VM_ASSERT, VM_CF_BLOCK_HANDLER(), VM_ENV_DATA_INDEX_ENV, VM_ENV_FLAG_ESCAPED, and VM_ENV_FLAGS().
Referenced by pass_passed_block_handler(), proc_new(), rb_block_arity(), rb_block_given_p(), rb_block_min_max_arity(), rb_mod_define_method(), rb_mod_refine(), and VM_STACK_ENV_WRITE().
st_table* rb_vm_fstring_table | ( | void | ) |
Definition at line 3196 of file vm.c.
References CONST_ID, cv, FIX2INT, GET_THREAD, GET_VM, ID2SYM, INT2FIX, rb_control_frame_struct::iseq, Qnil, rb_ary_new4, rb_const_get(), rb_hash_aref(), rb_hash_new(), rb_insn_operand_intern(), rb_intern, ruby_vm_collect_usage_func_insn, ruby_vm_collect_usage_func_operand, ruby_vm_collect_usage_func_register, and snprintf.
Referenced by Init_String(), rb_str_free(), and register_fstring().
rb_control_frame_t* rb_vm_get_binding_creatable_next_cfp | ( | const rb_thread_t * | th, |
const rb_control_frame_t * | cfp | ||
) |
Definition at line 477 of file vm.c.
References rb_control_frame_struct::iseq, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, and RUBY_VM_PREVIOUS_CONTROL_FRAME.
Referenced by rb_tracearg_binding(), rb_vm_make_binding(), and rb_vm_stack_to_heap().
rb_control_frame_t* rb_vm_get_ruby_level_next_cfp | ( | const rb_thread_t * | th, |
const rb_control_frame_t * | cfp | ||
) |
Definition at line 489 of file vm.c.
References RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, and VM_FRAME_RUBYFRAME_P().
Referenced by caller_location(), eval_string_with_cref(), fill_path_and_lineno(), method_definition_set(), name_err_initialize(), rb_scope_module_func_check(), rb_scope_visibility_get(), rb_source_location(), rb_sourcefile(), rb_sourcefilename(), rb_sourceline(), rb_vm_cbase(), rb_vm_cref(), rb_vm_cref_in_context(), rb_vm_cref_replace_with_duplicated_cref(), rb_vm_make_binding(), and vm_make_proc_with_iseq().
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().
VALUE rb_vm_invoke_proc | ( | rb_thread_t * | th, |
rb_proc_t * | proc, | ||
int | argc, | ||
const VALUE * | argv, | ||
VALUE | passed_block_handler | ||
) |
Definition at line 1150 of file vm.c.
References rb_proc_t::block, rb_proc_t::is_from_method, VM_ASSERT, vm_block_handler_verify(), vm_block_self(), vm_invoke_bmethod(), and vm_invoke_proc().
Referenced by rb_fiber_start(), rb_proc_call(), rb_proc_call_with_block(), thread_do_start(), vm_call0_body(), and vm_call_opt_call().
void rb_vm_jump_tag_but_local_jump | ( | int | state | ) |
Definition at line 1431 of file vm.c.
References JUMP_TAG, NIL_P, NORETURN(), Qundef, rb_exc_raise(), rb_vm_make_jump_tag_but_local_jump(), rb_captured_block::val, and vm_iter_break().
Definition at line 1392 of file vm.c.
References make_localjump_error(), and rb_exc_raise().
Referenced by check_block_handler(), rb_need_block(), vm_invoke_block(), vm_iter_break(), and vm_throw_start().
VALUE rb_vm_make_binding | ( | rb_thread_t * | th, |
const rb_control_frame_t * | src_cfp | ||
) |
Definition at line 889 of file vm.c.
References rb_block::as, rb_binding_t::block, rb_iseq_struct::body, rb_block::captured, rb_captured_block::code, rb_binding_t::first_lineno, GetBindingPtr, rb_captured_block::iseq, rb_control_frame_struct::iseq, rb_iseq_constant_body::location, rb_iseq_location_struct::path, rb_binding_t::path, rb_binding_alloc(), rb_cBinding, rb_eRuntimeError, rb_raise(), rb_vm_get_binding_creatable_next_cfp(), rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_captured_block::self, rb_control_frame_struct::self, vm_bind_update_env(), and vm_make_env_object().
Referenced by collect_caller_bindings(), rb_binding_new(), and rb_tracearg_binding().
Definition at line 1399 of file vm.c.
References GET_THREAD, make_localjump_error(), Qnil, Qundef, result, TAG_BREAK, TAG_NEXT, TAG_REDO, TAG_RETRY, and TAG_RETURN.
Referenced by rb_fiber_start(), rb_load_internal0(), and rb_vm_jump_tag_but_local_jump().
VALUE rb_vm_make_proc | ( | rb_thread_t * | th, |
const struct rb_captured_block * | captured, | ||
VALUE | klass | ||
) |
Definition at line 863 of file vm.c.
References FALSE, and rb_vm_make_proc_lambda().
Referenced by args_setup_block_parameter(), vm_block_handler_escape(), vm_block_handler_to_proc(), and vm_make_proc_with_iseq().
VALUE rb_vm_make_proc_lambda | ( | rb_thread_t * | th, |
const struct rb_captured_block * | captured, | ||
VALUE | klass, | ||
int8_t | is_lambda | ||
) |
Definition at line 869 of file vm.c.
References block_type_ifunc, block_type_iseq, rb_captured_block::code, rb_captured_block::ep, FALSE, imemo_iseq, rb_proc_create_from_captured(), RB_TYPE_P, rb_thread_struct::safe_level, T_IMEMO, rb_captured_block::val, VM_ASSERT, VM_CAPTURED_BLOCK_TO_CFP(), VM_ENV_ESCAPED_P(), and vm_make_env_object().
Referenced by proc_new(), rb_mod_define_method(), and rb_vm_make_proc().
void rb_vm_mark | ( | void * | ptr | ) |
Definition at line 2101 of file vm.c.
References rb_vm_struct::cmd, rb_vm_struct::coverages, rb_vm_struct::defined_module_hash, rb_vm_struct::event_hooks, rb_vm_struct::expanded_load_path, rb_vm_struct::living_threads, rb_vm_struct::load_path, rb_vm_struct::load_path_check_cache, rb_vm_struct::load_path_snapshot, rb_vm_struct::loaded_features, rb_vm_struct::loaded_features_snapshot, rb_vm_struct::loading_table, rb_vm_struct::mark_object_ary, rb_gc_mark(), rb_mark_tbl(), rb_vm_trace_mark_event_hooks(), RUBY_GC_INFO, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_UNLESS_NULL, RUBY_NSIG, rb_thread_struct::self, rb_vm_struct::thgroup_default, rb_vm_struct::top_self, and rb_vm_struct::trap_list.
Referenced by gc_mark_roots().
void rb_vm_pop_cfunc_frame | ( | void | ) |
Definition at line 523 of file vm.c.
References rb_callable_method_entry_struct::called_id, rb_thread_struct::cfp, rb_callable_method_entry_struct::def, rb_control_frame_struct::ep, EXEC_EVENT_HOOK, GET_THREAD, rb_method_definition_struct::original_id, rb_callable_method_entry_struct::owner, Qnil, rb_vm_frame_method_entry(), RUBY_DTRACE_CMETHOD_RETURN_HOOK, RUBY_EVENT_C_RETURN, rb_control_frame_struct::self, and vm_pop_frame().
Referenced by raise_method_missing(), rb_mod_const_missing(), and rb_vm_rewind_cfp().
void rb_vm_register_special_exception | ( | enum ruby_special_exceptions | sp, |
VALUE | cls, | ||
const char * | mesg | ||
) |
Definition at line 2142 of file vm.c.
References GET_VM, OBJ_FREEZE, OBJ_TAINT, rb_exc_new3, rb_gc_register_mark_object(), rb_obj_freeze(), rb_str_new2, and rb_vm_struct::special_exceptions.
Referenced by Init_eval(), Init_GC(), Init_Proc(), and Init_Thread().
void rb_vm_rewind_cfp | ( | rb_thread_t * | th, |
rb_control_frame_t * | cfp | ||
) |
Definition at line 535 of file vm.c.
References rb_thread_struct::cfp, rb_vm_pop_cfunc_frame(), rb_vm_pop_frame(), VM_FRAME_MAGIC_CFUNC, and VM_FRAME_TYPE().
Referenced by rb_iterate0(), rb_protect(), rb_rescue2(), and vm_catch_protect().
|
inlinestatic |
Definition at line 35 of file vm.c.
References rb_control_frame_struct::ep, NULL, RUBY_VM_END_CONTROL_FRAME, and RUBY_VM_PREVIOUS_CONTROL_FRAME.
Referenced by vm_iter_break(), and vm_throw_start().
void rb_vm_set_progname | ( | VALUE | filename | ) |
Definition at line 3096 of file vm.c.
References rb_iseq_struct::body, GET_VM, rb_control_frame_struct::iseq, rb_iseq_constant_body::location, rb_iseq_location_struct::path, RB_OBJ_WRITE, rb_thread_struct::stack, and rb_thread_struct::stack_size.
Referenced by ruby_script(), and ruby_set_script_name().
void rb_vm_stack_to_heap | ( | rb_thread_t * | th | ) |
Definition at line 729 of file vm.c.
References rb_thread_struct::cfp, rb_vm_get_binding_creatable_next_cfp(), RUBY_VM_PREVIOUS_CONTROL_FRAME, and vm_make_env_object().
Referenced by cont_capture().
VALUE rb_vm_top_self | ( | void | ) |
Definition at line 3151 of file vm.c.
References GET_VM.
Referenced by autoload_require(), eval_string_from_file_helper(), Init_eval(), Init_eval_method(), Init_Proc(), Init_top_self(), Init_VM(), rb_eval_cmd(), rb_eval_string_wrap(), rb_load_internal0(), rb_require_internal(), require_libraries(), ruby_eval_string_from_file(), and ruby_thread_init().
void rb_vm_trace_mark_event_hooks | ( | rb_hook_list_t * | hooks | ) |
Definition at line 49 of file vm_trace.c.
References rb_event_hook_struct::data, rb_hook_list_struct::hooks, rb_event_hook_struct::next, and rb_gc_mark().
Referenced by rb_thread_mark(), rb_vm_call_cfunc(), and rb_vm_mark().
int ruby_th_dtrace_setup | ( | rb_thread_t * | th, |
VALUE | klass, | ||
ID | id, | ||
struct ruby_dtrace_method_hook_args * | args | ||
) |
Definition at line 331 of file vm.c.
References BUILTIN_TYPE, ruby_dtrace_method_hook_args::classname, classname(), FALSE, ruby_dtrace_method_hook_args::filename, FL_SINGLETON, FL_TEST, GET_THREAD, ruby_dtrace_method_hook_args::klass, ruby_dtrace_method_hook_args::line_no, ruby_dtrace_method_hook_args::methodname, ruby_dtrace_method_hook_args::name, name, NIL_P, rb_attr_get(), rb_class_path_no_cache(), rb_id2name(), rb_source_loc(), rb_thread_method_id_and_class(), RB_TYPE_P, RBASIC, StringValuePtr, T_CLASS, T_ICLASS, T_MODULE, and TRUE.
Definition at line 2547 of file vm.c.
References GET_THREAD, GetThreadPtr, Qfalse, rb_hash_new(), rb_intern, rb_ivar_set(), rb_vm_top_self(), rb_thread_struct::root_svar, th_init(), rb_thread_struct::top_self, rb_thread_struct::top_wrapper, and rb_thread_struct::vm.
Referenced by rb_thread_alloc().
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.
Definition at line 3173 of file vm.c.
References rb_vm_struct::debug.
Referenced by rb_ruby_debug_ptr().
int ruby_vm_destruct | ( | rb_vm_t * | vm | ) |
Definition at line 2170 of file vm.c.
References free_loading_table_entry(), rb_vm_struct::frozen_strings, rb_vm_struct::loading_table, rb_vm_struct::main_thread, rb_vm_struct::objspace, rb_fiber_reset_root_local_storage(), rb_objspace_free(), rb_vm_gvl_destroy(), rb_vm_living_threads_init(), RUBY_FREE_ENTER, RUBY_FREE_LEAVE, ruby_mimfree(), ruby_vm_run_at_exit_hooks(), rb_thread_struct::self, st_foreach, st_free_table, and thread_free().
|
static |
Definition at line 571 of file vm.c.
References rb_vm_struct::at_exit, check_env_value(), env, free(), func, rb_at_exit_list::func, and rb_at_exit_list::next.
Referenced by ruby_vm_destruct().
Definition at line 3167 of file vm.c.
References rb_vm_struct::verbose.
Referenced by rb_ruby_verbose_ptr().
|
static |
|
static |
Definition at line 2508 of file vm.c.
References rb_thread_struct::cfp, rb_vm_struct::default_params, rb_thread_struct::errinfo, rb_thread_struct::last_status, rb_thread_struct::local_storage_recursive_hash, rb_thread_struct::local_storage_recursive_hash_for_trace, malloc, rb_thread_struct::name, Qfalse, Qnil, Qundef, rb_sigaltstack_size(), rb_thread_struct::root_svar, rb_thread_struct::self, rb_thread_struct::stack, rb_thread_struct::stack_size, rb_thread_struct::status, thread_recycle_stack(), THREAD_RUNNABLE, rb_vm_struct::thread_vm_stack_size, rb_thread_struct::vm, VM_BLOCK_HANDLER_NONE, VM_ENV_FLAG_LOCAL, VM_FRAME_FLAG_CFRAME, VM_FRAME_FLAG_FINISH, VM_FRAME_MAGIC_DUMMY, and vm_push_frame().
Referenced by Init_BareVM(), and ruby_thread_init().
Definition at line 2498 of file vm.c.
References thread_data_type, and TypedData_Make_Struct.
Referenced by rb_thread_alloc().
|
static |
Definition at line 2416 of file vm.c.
References free(), rb_thread_struct::keeping_mutexes, rb_thread_struct::local_storage, rb_thread_struct::locking_mutex, rb_vm_struct::main_thread, NULL, Qfalse, rb_bug(), rb_thread_recycle_stack_release(), rb_thread_struct::root_fiber, RUBY_FREE_ENTER, RUBY_FREE_LEAVE, RUBY_FREE_UNLESS_NULL, RUBY_GC_INFO, ruby_xfree(), st_free_table, rb_thread_struct::stack, and rb_thread_struct::vm.
Referenced by ruby_vm_destruct().
|
static |
Definition at line 2461 of file vm.c.
References rb_thread_struct::local_storage, rb_thread_struct::root_fiber, size, st_memsize(), and rb_thread_struct::stack_size.
|
static |
Definition at line 2320 of file vm.c.
References ALLOC_N, and thread_recycle_stack_count.
Referenced by th_init().
|
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().
|
static |
Definition at line 270 of file vm.c.
References argc, argv, rb_block::as, rb_binding_t::block, rb_block::captured, rb_captured_block::code, env, rb_captured_block::ep, rb_env_t::ep, rb_captured_block::iseq, rb_env_t::iseq, vm_invoke_bmethod(), vm_invoke_proc(), and vm_make_env_object().
Referenced by eval_string_with_cref(), rb_binding_add_dynavars(), rb_vm_make_binding(), and vm_set_main_stack().
|
static |
Definition at line 615 of file vm.c.
References block_handler_type_ifunc, block_handler_type_iseq, block_handler_type_proc, block_handler_type_symbol, rb_cProc, rb_vm_make_proc(), VM_BH_TO_CAPT_BLOCK(), vm_block_handler_type(), and VM_UNREACHABLE.
Referenced by vm_make_env_each().
|
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().
|
inlinestatic |
Definition at line 75 of file vm.c.
References VM_CF_LEP(), and VM_ENV_BLOCK_HANDLER().
Referenced by check_block_handler(), rb_f_block_given_p(), rb_iterate0(), rb_vm_frame_block_handler(), rb_yield_refine_block(), VM_CF_PREV_EP(), vm_invoke_block(), and yield_under().
|
inlinestatic |
Definition at line 62 of file vm.c.
References rb_control_frame_struct::ep, and VM_EP_LEP().
Referenced by rb_vm_ep_local_ep(), rb_yield_refine_block(), VM_CF_BLOCK_HANDLER(), vm_cfp_svar_get(), vm_cfp_svar_set(), vm_throw_start(), and yield_under().
|
inlinestatic |
Definition at line 68 of file vm.c.
References rb_control_frame_struct::ep, PUREFUNC(), VM_CF_BLOCK_HANDLER(), and VM_ENV_PREV_EP().
Referenced by rb_f_local_variables(), and vm_iter_break().
|
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().
|
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().
|
static |
Definition at line 146 of file vm.c.
References GET_THREAD, rb_control_frame_struct::self, and VM_ASSERT.
Referenced by eval_string_with_cref(), rb_iterate0(), VM_BH_FROM_CFP_P(), vm_call_iseq_setup_tailcall(), vm_caller_setup_arg_block(), and vm_make_proc_with_iseq().
|
static |
Definition at line 771 of file vm.c.
References collect_local_variables_in_env(), VM_ENV_ENVVAL_PTR(), and VM_ENV_ESCAPED_P().
Definition at line 259 of file vm.c.
References CREF_CLASS(), CREF_NEXT(), rb_class_path(), and RSTRING_PTR.
Referenced by method_definition_set().
Definition at line 223 of file vm.c.
References CREF_CLASS(), CREF_NEXT(), CREF_OMOD_SHARED_UNSET(), CREF_PUSHED_BY_EVAL(), CREF_REFINEMENTS(), CREF_REFINEMENTS_SET(), CREF_SCOPE_VISI(), rb_scope_visi_struct::method_visi, rb_scope_visi_struct::module_func, NIL_P, rb_hash_dup(), and vm_cref_new().
Referenced by cref_replace_with_duplicated_cref_each_frame(), and eval_string_with_cref().
|
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().
|
static |
Definition at line 177 of file vm.c.
References CREF_NEXT(), CREF_OMOD_SHARED_SET(), CREF_PUSHED_BY_EVAL_SET(), CREF_REFINEMENTS(), FALSE, imemo_cref, rb_scope_visi_struct::method_visi, NIL_P, NULL, Qnil, rb_imemo_new(), and TRUE.
Referenced by vm_cref_new(), and vm_cref_new_use_prev().
|
static |
Definition at line 241 of file vm.c.
References FALSE, METHOD_VISI_PRIVATE, NULL, rb_cObject, rb_thread_struct::top_wrapper, and vm_cref_new().
Referenced by method_definition_set(), rb_vm_call_cfunc(), rb_vm_cref_new_toplevel(), and vm_set_top_stack().
|
static |
Definition at line 217 of file vm.c.
References TRUE, and vm_cref_new0().
Referenced by rb_vm_rewrite_cref().
|
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().
|
static |
Definition at line 2273 of file vm.c.
References check_machine_stack_size(), rb_vm_struct::default_params, rb_vm_struct::fiber_machine_stack_size, rb_vm_struct::fiber_vm_stack_size, get_param(), RUBY_VM_FIBER_MACHINE_STACK_SIZE, RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN, RUBY_VM_FIBER_VM_STACK_SIZE, RUBY_VM_FIBER_VM_STACK_SIZE_MIN, RUBY_VM_THREAD_MACHINE_STACK_SIZE, RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN, RUBY_VM_THREAD_VM_STACK_SIZE, RUBY_VM_THREAD_VM_STACK_SIZE_MIN, rb_vm_struct::thread_machine_stack_size, and rb_vm_struct::thread_vm_stack_size.
Referenced by vm_init2().
|
static |
Definition at line 2572 of file vm.c.
References CREF_CLASS(), METHOD_VISI_PUBLIC, NIL_P, rb_add_method_iseq(), rb_eTypeError, rb_raise(), rb_scope_module_func_check(), rb_scope_visibility_get(), rb_singleton_class(), and rb_vm_cref().
Referenced by m_core_define_method(), and m_core_define_singleton_method().
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().
|
static |
Definition at line 1763 of file vm.c.
References rb_iseq_struct::body, rb_callable_method_entry_struct::called_id, rb_iseq_constant_body::catch_table, rb_thread_struct::cfp, iseq_catch_table_entry::cont, rb_callable_method_entry_struct::def, iseq_catch_table_entry::end, rb_control_frame_struct::ep, err, rb_thread_struct::errinfo, EXEC_EVENT_HOOK, EXEC_TAG, FALSE, hook_before_rewind(), iseq_catch_table_entry::iseq, rb_control_frame_struct::iseq, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::local_table_size, NULL, rb_method_definition_struct::original_id, rb_callable_method_entry_struct::owner, rb_control_frame_struct::pc, Qnil, rb_iseq_check(), rb_vm_frame_method_entry(), rb_vm_pop_frame(), result, RUBY_DTRACE_CMETHOD_RETURN_HOOK, RUBY_EVENT_C_RETURN, rb_control_frame_struct::self, iseq_catch_table_entry::sp, rb_control_frame_struct::sp, rb_iseq_constant_body::stack_max, iseq_catch_table_entry::start, rb_thread_struct::state, TAG_BREAK, TAG_NEXT, TAG_RAISE, TAG_REDO, TAG_RETRY, TAG_RETURN, TH_JUMP_TAG, TH_POP_TAG, TH_PUSH_TAG, TH_TMPPOP_TAG, THROW_DATA_CATCH_FRAME(), THROW_DATA_CATCH_FRAME_SET(), THROW_DATA_STATE_SET(), THROW_DATA_VAL(), TRUE, iseq_catch_table_entry::type, UNLIKELY, vm_base_ptr(), vm_exec_core(), VM_FRAME_FINISHED_P(), VM_FRAME_MAGIC_CFUNC, VM_FRAME_MAGIC_RESCUE, VM_FRAME_TYPE(), VM_GUARDED_PREV_EP, and vm_push_frame().
Referenced by invoke_block(), invoke_bmethod(), rb_iseq_eval(), and rb_iseq_eval_main().
|
static |
Definition at line 501 of file vm.c.
References rb_control_frame_struct::ep, FALSE, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, VM_ENV_FLAGS(), VM_FRAME_FLAG_PASSED, and VM_FRAME_RUBYFRAME_P().
Referenced by rb_current_realfilepath(), rb_f_block_given_p(), and rb_f_local_variables().
|
static |
Definition at line 2301 of file vm.c.
References MEMZERO, rb_vm_living_threads_init(), rb_vm_struct::src_encoding_index, and vm_default_params_setup().
Referenced by Init_BareVM().
|
static |
Definition at line 1549 of file vm.c.
References AREF, C, DIV, MATCH, MAX, Max, MIN, Min, MOD, OP, rb_bug(), st_init_numtable, VM_FRAME_MAGIC_BLOCK, VM_FRAME_MAGIC_CFUNC, VM_FRAME_MAGIC_CLASS, VM_FRAME_MAGIC_EVAL, VM_FRAME_MAGIC_IFUNC, VM_FRAME_MAGIC_LAMBDA, VM_FRAME_MAGIC_METHOD, VM_FRAME_MAGIC_PROC, VM_FRAME_MAGIC_RESCUE, VM_FRAME_MAGIC_TOP, and VM_FRAME_TYPE().
Referenced by Init_VM().
|
static |
Definition at line 1143 of file vm.c.
References rb_proc_t::block, invoke_block_from_c_unsplattable(), and TRUE.
Referenced by rb_vm_invoke_proc(), vm_bind_update_env(), and vm_call_bmethod_body().
|
static |
Definition at line 1120 of file vm.c.
References rb_proc_t::block, EXEC_TAG, invoke_block_from_c_unsplattable(), rb_proc_t::is_lambda, Qundef, rb_thread_struct::safe_level, rb_proc_t::safe_level, TH_JUMP_TAG, TH_POP_TAG, TH_PUSH_TAG, and rb_captured_block::val.
Referenced by rb_vm_invoke_proc(), and vm_bind_update_env().
|
static |
Definition at line 1450 of file vm.c.
References rb_thread_struct::cfp, rb_thread_struct::errinfo, next_not_local_frame(), rb_vm_localjump_error(), rb_vm_search_cf_from_ep(), rb_thread_struct::state, TAG_BREAK, TH_JUMP_TAG, THROW_DATA_NEW(), and VM_CF_PREV_EP().
Referenced by rb_iter_break(), rb_iter_break_value(), and rb_vm_jump_tag_but_local_jump().
|
static |
Definition at line 633 of file vm.c.
References ALLOC_N, rb_iseq_struct::body, env, env_size(), rb_control_frame_struct::ep, rb_control_frame_struct::iseq, rb_iseq_constant_body::local_table_size, MEMCPY, NULL, Qfalse, RB_OBJ_WRITE, RUBY_VM_PREVIOUS_CONTROL_FRAME, VM_ASSERT, vm_block_handler_escape(), VM_BLOCK_HANDLER_NONE, VM_ENV_BLOCK_HANDLER(), VM_ENV_DATA_INDEX_SPECVAL, VM_ENV_DATA_SIZE, VM_ENV_ENVVAL(), VM_ENV_ESCAPED_P(), VM_ENV_FLAG_ESCAPED, VM_ENV_FLAG_WB_REQUIRED, VM_ENV_FLAGS_SET(), VM_ENV_LOCAL_P(), vm_env_new(), VM_ENV_PREV_EP(), VM_FORCE_WRITE_SPECIAL_CONST(), VM_FRAME_RUBYFRAME_P(), VM_GUARDED_PREV_EP, and VM_STACK_ENV_WRITE().
Referenced by vm_make_env_object().
|
static |
Definition at line 717 of file vm.c.
References check_env_value(), PROCDEBUG, and vm_make_env_each().
Referenced by eval_string_with_cref(), rb_binding_add_dynavars(), rb_vm_make_binding(), rb_vm_make_proc_lambda(), rb_vm_stack_to_heap(), vm_bind_update_env(), and vm_set_main_stack().
|
static |
Definition at line 2206 of file vm.c.
References DEFINED_EXPR, rb_vm_struct::defined_strings, rb_vm_struct::living_thread_num, and size.
|
static |
Definition at line 1167 of file vm.c.
References rb_control_frame_struct::pc, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, and RUBY_VM_PREVIOUS_CONTROL_FRAME.
Referenced by vm_cfp_svar_get(), and vm_cfp_svar_set().
|
static |
Definition at line 169 of file vm.c.
References rb_thread_struct::passed_block_handler, and VM_BLOCK_HANDLER_NONE.
Referenced by call_method_entry(), method_missing(), and vm_call0_body().
|
static |
Definition at line 1484 of file vm.c.
References ARRAY_REDEFINED_OP_FLAG, FALSE_REDEFINED_OP_FLAG, FLOAT_REDEFINED_OP_FLAG, HASH_REDEFINED_OP_FLAG, INTEGER_REDEFINED_OP_FLAG, NIL_REDEFINED_OP_FLAG, rb_cArray, rb_cFalseClass, rb_cFloat, rb_cHash, rb_cInteger, rb_cNilClass, rb_cRegexp, rb_cString, rb_cSymbol, rb_cTime, rb_cTrueClass, REGEXP_REDEFINED_OP_FLAG, STRING_REDEFINED_OP_FLAG, SYMBOL_REDEFINED_OP_FLAG, TIME_REDEFINED_OP_FLAG, and TRUE_REDEFINED_OP_FLAG.
Referenced by rb_vm_check_redefinition_by_prepend(), and rb_vm_check_redefinition_opt_method().
|
static |
Definition at line 450 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::local_table_size, rb_control_frame_struct::sp, rb_iseq_constant_body::stack_max, vm_block_ep(), vm_block_self(), VM_FRAME_FLAG_FINISH, VM_FRAME_MAGIC_EVAL, VM_GUARDED_PREV_EP, and vm_push_frame().
Referenced by rb_binding_add_dynavars(), and vm_set_main_stack().
|
static |
Definition at line 460 of file vm.c.
References rb_binding_t::block, rb_iseq_struct::body, rb_thread_struct::cfp, GetBindingPtr, rb_iseq_constant_body::local_table_size, rb_cObject, rb_const_get(), rb_intern, RUBY_ASSERT_MESG, vm_bind_update_env(), vm_make_env_object(), and vm_set_eval_stack().
Referenced by rb_iseq_eval_main().
|
static |
Definition at line 436 of file vm.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, rb_iseq_constant_body::iseq_encoded, rb_iseq_constant_body::local_table_size, rb_eTypeError, rb_raise(), rb_control_frame_struct::sp, rb_iseq_constant_body::stack_max, rb_thread_struct::top_self, rb_iseq_constant_body::type, VM_BLOCK_HANDLER_NONE, vm_cref_new_toplevel(), VM_ENV_FLAG_LOCAL, VM_FRAME_FLAG_FINISH, VM_FRAME_MAGIC_TOP, and vm_push_frame().
Referenced by rb_iseq_eval().
Definition at line 389 of file vm.c.
References hash(), key, NIL_P, PRIsVALUE, Qnil, rb_eArgError, rb_eTypeError, rb_hash_new(), rb_raise(), rb_scan_args(), rb_sym2str, RB_TYPE_P, S, SET, SYMBOL_P, and T_HASH.
Referenced by Init_VM().
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().
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().
|
static |
Definition at line 1076 of file vm.c.
References check_block_handler(), FALSE, invoke_block_from_c_splattable(), NULL, and VM_BLOCK_HANDLER_NONE.
|
static |
Definition at line 1092 of file vm.c.
References check_block_handler(), FALSE, invoke_block_from_c_splattable(), NULL, TRUE, and VM_BLOCK_HANDLER_NONE.
|
static |
Definition at line 1084 of file vm.c.
References check_block_handler(), FALSE, invoke_block_from_c_splattable(), and NULL.
|
static |
Definition at line 1068 of file vm.c.
References check_block_handler(), FALSE, invoke_block_from_c_splattable(), and VM_BLOCK_HANDLER_NONE.
VALUE rb_cRubyVM |
Definition at line 310 of file vm.c.
Referenced by Init_ISeq().
const struct st_hash_type rb_fstring_hash_type |
size_t rb_gc_stack_maxsize |
Referenced by core_hash_merge_kwd().
VALUE* rb_gc_stack_start |
Referenced by core_hash_merge_kwd().
VALUE rb_mRubyVMFrozenCore |
Definition at line 312 of file vm.c.
Referenced by mlambda(), mproc(), and rb_threadptr_exec_event_hooks_orig().
rb_thread_t* ruby_current_thread = 0 |
const rb_data_type_t ruby_threadptr_data_type |
|
static |
void(* ruby_vm_collect_usage_func_insn) (int insn) = NULL |
Definition at line 3366 of file vm.c.
Referenced by rb_vm_fstring_table().
Definition at line 3367 of file vm.c.
Referenced by rb_vm_fstring_table().
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().
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().
|
static |
|
static |
|
static |
Definition at line 2317 of file vm.c.
Referenced by thread_recycle_stack().
|
static |
|
static |