Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Internal header for RubyVM. More...
#include "ruby/internal/stdbool.h"
#include "internal/serial.h"
#include "internal/static_assert.h"
#include "ruby/ruby.h"
#include "ruby/st.h"
Go to the source code of this file.
Macros | |
#define | RUBY_DTRACE_CREATE_HOOK(name, arg) RUBY_DTRACE_HOOK(name##_CREATE, arg) |
#define | RUBY_DTRACE_HOOK(name, arg) |
Typedefs | |
typedef void | rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE) |
Enumerations | |
enum | method_missing_reason { MISSING_NOENTRY = 0x00 , MISSING_PRIVATE = 0x01 , MISSING_PROTECTED = 0x02 , MISSING_FCALL = 0x04 , MISSING_VCALL = 0x08 , MISSING_SUPER = 0x10 , MISSING_MISSING = 0x20 , MISSING_NONE = 0x40 } |
Internal header for RubyVM.
Definition in file vm.h.
#define RUBY_DTRACE_CREATE_HOOK | ( | name, | |
arg | |||
) | RUBY_DTRACE_HOOK(name##_CREATE, arg) |
#define RUBY_DTRACE_HOOK | ( | name, | |
arg | |||
) |
Definition at line 1039 of file vm_backtrace.c.
References ALL_BACKTRACE_LINES, BACKTRACE_START, oldbt_arg::data, oldbt_arg::func, print_to_arg::iter, NULL, and print_to_arg::output.
Definition at line 471 of file vm_backtrace.c.
References rb_typeddata_is_kind_of().
void rb_backtrace_print_as_bugreport | ( | void | ) |
Definition at line 994 of file vm_backtrace.c.
References ALL_BACKTRACE_LINES, BACKTRACE_START, oldbt_arg::data, oldbt_arg::func, and NULL.
Referenced by rb_vm_bugreport().
Definition at line 864 of file vm_backtrace.c.
References GetCoreDataFromValue, and rb_backtrace_struct::locary.
Definition at line 809 of file vm_backtrace.c.
References bt_iter_arg::bt, GetCoreDataFromValue, and rb_backtrace_struct::strary.
void rb_backtrace_use_iseq_first_lineno_for_last_location | ( | VALUE | self | ) |
Definition at line 821 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace, rb_backtrace_struct::backtrace_size, rb_backtrace_location_struct::body, rb_iseq_struct::body, bt_iter_arg::bt, rb_iseq_location_struct::first_lineno, FIX2INT, GetCoreDataFromValue, rb_backtrace_location_struct::iseq, rb_iseq_constant_body::location, rb_backtrace_location_struct::type, and VM_ASSERT.
VALUE rb_check_block_call | ( | VALUE | obj, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
rb_block_call_func_t | bl_proc, | ||
VALUE | data2 | ||
) |
Definition at line 1625 of file vm_eval.c.
References argc, iter_method_arg::argc, argv, iter_method_arg::argv, iter_method_arg::kw_splat, iter_method_arg::mid, iter_method_arg::obj, and rb_iterate().
VALUE rb_check_funcall_basic_kw | ( | VALUE | recv, |
ID | mid, | ||
VALUE | ancestor, | ||
int | argc, | ||
const VALUE * | argv, | ||
int | kw_splat | ||
) |
Calls a method only if it is the basic method of ancestor
otherwise returns Qundef;.
recv | receiver of the method |
mid | an ID that represents the name of the method |
ancestor | the Class that defined the basic method |
argc | the number of arguments |
argv | pointer to an array of method arguments |
kw_splat | bool |
Definition at line 1111 of file vm_eval.c.
References argc, argv, CLASS_OF, rb_callable_method_entry_struct::defined_class, rb_callcache::klass, METHOD_ENTRY_BASIC, Qundef, rb_callable_method_entry(), rb_vm_call0(), and RBASIC_CLASS.
Referenced by rb_hash().
Definition at line 647 of file vm_eval.c.
References argc, argv, def(), rescue_funcall_args::mid, RB_NO_KEYWORDS, and rescue_funcall_args::recv.
Referenced by rb_get_path_check_to_string(), and rb_time_zone_abbreviation().
VALUE rb_check_funcall_with_hook | ( | VALUE | recv, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
rb_check_funcall_hook * | hook, | ||
VALUE | arg | ||
) |
Definition at line 679 of file vm_eval.c.
References argc, argv, rescue_funcall_args::mid, rb_check_funcall_with_hook_kw(), RB_NO_KEYWORDS, and rescue_funcall_args::recv.
VALUE rb_check_funcall_with_hook_kw | ( | VALUE | recv, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
rb_check_funcall_hook * | hook, | ||
VALUE | arg, | ||
int | kw_splat | ||
) |
Definition at line 653 of file vm_eval.c.
References argc, argv, CLASS_OF, rescue_funcall_args::ec, FALSE, rescue_funcall_args::kw_splat, rescue_funcall_args::mid, Qundef, rb_vm_call_kw(), rescue_funcall_args::recv, rescue_funcall_args::respond, stack_check, and TRUE.
Referenced by rb_check_funcall_with_hook(), and rb_obj_dig().
void rb_check_stack_overflow | ( | void | ) |
Definition at line 331 of file vm_eval.c.
References ruby_current_ec_key, and stack_check.
VALUE rb_current_realfilepath | ( | void | ) |
Definition at line 2569 of file vm_eval.c.
References rb_execution_context_struct::cfp, rb_control_frame_struct::iseq, Qnil, rb_iseq_realpath(), and RUBY_VM_PREVIOUS_CONTROL_FRAME.
Referenced by rb_f_require_relative().
VALUE rb_ec_backtrace_object | ( | const struct rb_execution_context_struct * | ec | ) |
int rb_ec_obj_respond_to | ( | struct rb_execution_context_struct * | ec, |
VALUE | obj, | ||
ID | id, | ||
int | priv | ||
) |
Definition at line 2552 of file vm_method.c.
References CLASS_OF.
Referenced by rb_obj_respond_to().
VALUE rb_lambda_call | ( | VALUE | obj, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
rb_block_call_func_t | bl_proc, | ||
int | min_argc, | ||
int | max_argc, | ||
VALUE | data2 | ||
) |
Definition at line 1598 of file vm_eval.c.
References argc, iter_method_arg::argc, argv, iter_method_arg::argv, iter_method_arg::kw_splat, iter_method_arg::mid, iter_method_arg::obj, rb_eArgError, rb_raise(), and rb_vm_ifunc_new().
VALUE rb_make_backtrace | ( | void | ) |
Definition at line 1059 of file vm_backtrace.c.
rb_serial_t rb_next_class_serial | ( | void | ) |
Definition at line 366 of file vm.c.
References NEXT_CLASS_SERIAL.
Definition at line 3003 of file vm.c.
References Qfalse, Qtrue, rb_typeddata_is_kind_of(), and thread_data_type.
Referenced by rb_objspace_call_finalizer().
void rb_print_backtrace | ( | void | ) |
Definition at line 753 of file vm_dump.c.
Referenced by rb_fatal(), and rb_vm_bugreport().
Definition at line 1600 of file vm.c.
References rb_execution_context_struct::cfp, rb_control_frame_struct::iseq, Qnil, rb_iseq_path(), rb_vm_get_ruby_level_next_cfp(), and rb_vm_get_sourceline().
Referenced by rb_source_location_cstr().
Definition at line 1616 of file vm.c.
References NIL_P, NULL, rb_source_location(), and RSTRING_PTR.
Referenced by rb_bug_for_fatal_signal(), rb_bug_without_die(), and rb_dtrace_setup().
const char * rb_type_str | ( | enum ruby_value_type | type | ) |
Definition at line 686 of file vm_eval.c.
References NULL, T_ARRAY, T_BIGNUM, T_CLASS, T_COMPLEX, T_DATA, T_FALSE, T_FILE, T_FIXNUM, T_FLOAT, T_HASH, T_ICLASS, T_IMEMO, T_MASK, T_MATCH, T_MODULE, T_MOVED, T_NIL, T_NODE, T_NONE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_SYMBOL, T_TRUE, T_UNDEF, T_ZOMBIE, and type_case.
Referenced by rb_insn_operand_intern().
Definition at line 2622 of file vm.c.
References rb_vm_struct::defined_module_hash, st_insert, and TRUE.
Referenced by rb_define_class(), rb_define_class_id_under(), and rb_define_module().
VALUE rb_vm_backtrace | ( | int | argc, |
const VALUE * | argv, | ||
struct rb_execution_context_struct * | ec | ||
) |
Definition at line 1162 of file vm_backtrace.c.
VALUE rb_vm_backtrace_locations | ( | int | argc, |
const VALUE * | argv, | ||
struct rb_execution_context_struct * | ec | ||
) |
Definition at line 1167 of file vm_backtrace.c.
void rb_vm_check_redefinition_by_prepend | ( | VALUE | klass | ) |
Definition at line 1873 of file vm.c.
References rb_id_table_foreach(), RCLASS_M_TBL, and RCLASS_ORIGIN.
Referenced by rb_prepend_module().
void rb_vm_each_stack_value | ( | void * | ptr, |
void(*)(VALUE, void *) | cb, | ||
void * | ctx | ||
) |
Definition at line 2501 of file vm.c.
References rb_execution_context_struct::cfp, rb_ractor_struct::cnt, rb_thread_struct::ec, NULL, ptr, rb_vm_struct::ractor, rb_ractor_struct::set, rb_vm_struct::set, rb_control_frame_struct::sp, rb_ractor_struct::threads, VM_ASSERT, and rb_execution_context_struct::vm_stack.
st_table * rb_vm_fstring_table | ( | void | ) |
Definition at line 3787 of file vm.c.
Referenced by Init_String(), and rb_str_free().
const void ** rb_vm_get_insns_address_table | ( | void | ) |
Definition at line 153 of file vm_exec.c.
Referenced by rb_vm_encoded_insn_data_table_init().
void rb_vm_inc_const_missing_count | ( | void | ) |
Definition at line 425 of file vm.c.
References ruby_vm_const_missing_count.
Referenced by rb_const_missing().
void rb_vm_mark | ( | void * | ptr | ) |
Definition at line 2538 of file vm.c.
References rb_vm_struct::cmd, rb_vm_struct::coverages, rb_vm_struct::defined_module_hash, rb_vm_struct::expanded_load_path, rb_vm_struct::global_cc_cache_table, len, 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_vm_struct::negative_cme_table, NULL, rb_vm_struct::orig_progname, ptr, rb_vm_struct::ractor, RARRAY_CONST_PTR, RARRAY_LEN, rb_gc_mark(), rb_gc_mark_movable(), rb_gc_mark_values(), rb_id_table_foreach_values(), rb_mark_tbl(), RUBY_GC_INFO, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_MOVABLE_UNLESS_NULL, RUBY_NSIG, rb_vm_struct::set, rb_vm_struct::top_self, rb_vm_struct::trap_list, VM_ASSERT, and VM_GLOBAL_CC_CACHE_TABLE_SIZE.
void rb_vm_pop_cfunc_frame | ( | void | ) |
Definition at line 625 of file vm.c.
References rb_callable_method_entry_struct::called_id, rb_execution_context_struct::cfp, rb_callable_method_entry_struct::def, rb_control_frame_struct::ep, EXEC_EVENT_HOOK, 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, and rb_control_frame_struct::self.
Referenced by rb_mod_const_missing(), and rb_vm_rewind_cfp().
const struct rb_callcache * rb_vm_search_method_slowpath | ( | const struct rb_callinfo * | ci, |
VALUE | klass | ||
) |
Definition at line 1729 of file vm_insnhelper.c.
References imemo_callcache, IMEMO_TYPE_P, rb_callcache::klass, METHOD_ENTRY_INVALIDATED, RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, T_CLASS, T_ICLASS, VM_ASSERT, and vm_cc_empty.
Definition at line 1151 of file vm_backtrace.c.
Definition at line 1157 of file vm_backtrace.c.
VALUE rb_vm_top_self | ( | void | ) |
Definition at line 3752 of file vm.c.
Referenced by Init_eval(), Init_eval_method(), Init_Proc(), Init_top_self(), Init_VM(), rb_eval_cmd_kw(), rb_eval_string_wrap(), and ruby_eval_string_from_file().
Definition at line 1980 of file vm_eval.c.
References block_handler_type_iseq, rb_execution_context_struct::cfp, rb_captured_block::ep, FALSE, NULL, rb_bug(), RB_NO_KEYWORDS, rb_captured_block::self, TRUE, and VM_ENV_DATA_INDEX_SPECVAL.
Definition at line 48 of file vm_insnhelper.c.
References rb_class_real(), rb_obj_alloc(), rb_obj_copy_ivar(), and RBASIC_CLASS.
Referenced by rb_memerror(), and rb_threadptr_execute_interrupts().
VALUE vm_exec | ( | struct rb_execution_context_struct * | ec, |
bool | mjit_enable_p | ||
) |
Definition at line 2151 of file vm.c.
References EC_EXEC_TAG, EC_POP_TAG, EC_PUSH_TAG, rb_execution_context_struct::errinfo, Qnil, Qundef, RAISED_STACKOVERFLOW, rb_ec_raised_reset, rb_execution_context_struct::tag, TAG_NONE, and VM_ASSERT.