Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Go to the source code of this file.
Data Structures | |
struct | local_var_list |
struct | rescue_funcall_args |
struct | iter_method_arg |
struct | eval_string_wrap_arg |
Macros | |
#define | id_mesg idMesg |
#define | type_case(t) t: return #t |
Typedefs | |
typedef enum call_type | call_type |
Enumerations | |
enum | call_type { CALL_PUBLIC , CALL_FCALL , CALL_VCALL , CALL_PUBLIC_KW , CALL_FCALL_KW , CALL_TYPE_MAX } |
enum call_type |
void Init_vm_eval | ( | void | ) |
Definition at line 2579 of file vm_eval.c.
References METHOD_VISI_PUBLIC, OPTIMIZED_METHOD_TYPE_SEND, rb_add_method(), rb_cBasicObject, rb_cModule, rb_define_class(), rb_define_global_function, rb_define_method, rb_define_private_method, rb_eArgError, rb_f_eval(), rb_f_send(), rb_mKernel, and VM_METHOD_TYPE_OPTIMIZED.
Referenced by Init_eval().
Calls a method.
recv | receiver of the method |
mid | an ID that represents the name of the method |
args | an Array object which contains method arguments |
Definition at line 1044 of file vm_eval.c.
References ALLOCA_N, argc, argv, CALL_FCALL, MEMCPY, OBJ_FREEZE, RARRAY_CONST_PTR, RARRAY_CONST_PTR_TRANSIENT, rb_ary_subseq, rb_funcallv, and RB_GC_GUARD.
VALUE rb_block_call | ( | VALUE | obj, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
rb_block_call_func_t | bl_proc, | ||
VALUE | data2 | ||
) |
Definition at line 1570 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_block_call_kw | ( | VALUE | obj, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
rb_block_call_func_t | bl_proc, | ||
VALUE | data2, | ||
int | kw_splat | ||
) |
Definition at line 1584 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().
Definition at line 298 of file vm_eval.c.
References argc, argv, PASS_PASSED_BLOCK_HANDLER_EC, and RB_NO_KEYWORDS.
Definition at line 290 of file vm_eval.c.
References argc, argv, and PASS_PASSED_BLOCK_HANDLER_EC.
VALUE rb_catch | ( | const char * | tag, |
rb_block_call_func_t | func, | ||
VALUE | data | ||
) |
Definition at line 2385 of file vm_eval.c.
References rb_catch_obj(), rb_cObject, rb_obj_alloc(), rb_sym_intern_ascii_cstr, and rb_vm_tag::tag.
VALUE rb_catch_obj | ( | VALUE | t, |
rb_block_call_func_t | func, | ||
VALUE | data | ||
) |
Definition at line 2427 of file vm_eval.c.
References EC_JUMP_TAG, rb_vm_tag::state, and t.
Referenced by rb_catch().
VALUE rb_catch_protect | ( | VALUE | t, |
rb_block_call_func * | func, | ||
VALUE | data, | ||
enum ruby_tag_type * | stateptr | ||
) |
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().
Definition at line 619 of file vm_eval.c.
References argc, argv, rescue_funcall_args::mid, Qundef, RB_NO_KEYWORDS, and rescue_funcall_args::recv.
Referenced by rb_get_message(), rb_iseq_load_iseq(), rb_range_values(), and rb_time_zone_abbreviation().
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().
Definition at line 613 of file vm_eval.c.
References argc, argv, rescue_funcall_args::kw_splat, rescue_funcall_args::mid, Qundef, and rescue_funcall_args::recv.
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_current_receiver | ( | void | ) |
Definition at line 306 of file vm_eval.c.
References rb_execution_context_struct::cfp, rb_eRuntimeError, rb_raise(), and rb_control_frame_struct::self.
Definition at line 1639 of file vm_eval.c.
References CALL_FCALL, and iter_method_arg::obj.
Definition at line 1909 of file vm_eval.c.
References EC_EXEC_TAG, EC_JUMP_TAG, EC_POP_TAG, EC_PUSH_TAG, NULL, Qnil, RARRAY_CONST_PTR, rb_funcallv_kw(), rb_vm_top_self(), T_STRING, and TAG_NONE.
Evaluates the given string in an isolated binding.
Here "isolated" means the binding does not inherit any other binding. This behaves same as the binding for required libraries.
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
str | Ruby code to evaluate. |
Exception | Raises an exception on error. |
Definition at line 1823 of file vm_eval.c.
References ruby_eval_string_from_file(), and str.
Evaluates the given string in an isolated binding.
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
str | Ruby code to evaluate. |
state | Being set to zero if succeeded. Nonzero if an error occurred. |
Definition at line 1845 of file vm_eval.c.
References rb_protect(), and str.
Evaluates the given string under a module binding in an isolated binding.
This is same as the binding for loaded libraries on "load('foo', true)".
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
str | Ruby code to evaluate. |
state | Being set to zero if succeeded. Nonzero if an error occurred. |
Definition at line 1877 of file vm_eval.c.
References rb_thread_struct::ec, EC_JUMP_TAG, eval_string_wrap_arg::klass, rb_extend_object(), rb_module_new(), rb_obj_clone(), rb_protect(), rb_vm_top_self(), str, eval_string_wrap_arg::str, TAG_NONE, rb_thread_struct::top_self, eval_string_wrap_arg::top_self, and rb_thread_struct::top_wrapper.
Definition at line 1778 of file vm_eval.c.
References argc, argv, NIL_P, NULL, NUM2INT, Qundef, rb_scan_args(), SafeStringValue, and StringValue.
Referenced by Init_vm_eval().
Definition at line 1295 of file vm_eval.c.
References argc, argv, and CALL_FCALL.
Referenced by Init_vm_eval().
Calls a method.
recv | receiver of the method |
mid | an ID that represents the name of the method |
n | the number of arguments |
... | arbitrary number of method arguments |
Definition at line 1077 of file vm_eval.c.
References ALLOCA_N, argv, and rb_funcallv.
Referenced by default_inspect(), DupConfigPtr(), Init_generator(), Init_ossl_digest(), Init_syslog(), Init_win32ole_variant(), InitVM_Enumerator(), ossl_time_split(), ossl_to_der(), rb_callable_receiver(), rb_class_inherited(), rb_cmpint(), rb_eql(), rb_equal(), rb_fiddle_generic_to_value(), rb_hash_default_value(), rb_io_flush_raw(), rb_iseq_add_local_tracepoint_recursively(), rb_num_coerce_bin(), rb_num_coerce_cmp(), rb_num_coerce_relop(), rb_obj_as_string(), rb_obj_dup(), rb_obj_init_dup_clone(), rb_obj_not_equal(), rb_scheduler_block(), rb_scheduler_close(), rb_scheduler_io_read(), rb_scheduler_io_wait(), rb_scheduler_io_write(), rb_scheduler_kernel_sleep(), rb_scheduler_process_wait(), rb_scheduler_unblock(), rb_str_upto_each(), and ruby_num_interval_step_size().
Definition at line 1149 of file vm_eval.c.
References argc, argv, PASS_PASSED_BLOCK_HANDLER, and rb_funcallv_public().
VALUE rb_funcall_passing_block_kw | ( | VALUE | recv, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
int | kw_splat | ||
) |
Definition at line 1156 of file vm_eval.c.
References argc, argv, CALL_PUBLIC, CALL_PUBLIC_KW, and PASS_PASSED_BLOCK_HANDLER.
VALUE rb_funcall_with_block_kw | ( | VALUE | recv, |
ID | mid, | ||
int | argc, | ||
const VALUE * | argv, | ||
VALUE | passed_procval, | ||
int | kw_splat | ||
) |
Definition at line 1173 of file vm_eval.c.
References argc, argv, CALL_PUBLIC, CALL_PUBLIC_KW, and NIL_P.
Referenced by rb_sym_proc_call().
Calls a method.
recv | receiver of the method |
mid | an ID that represents the name of the method |
argc | the number of arguments |
argv | pointer to an array of method arguments |
Definition at line 1024 of file vm_eval.c.
References argc, argv, and CALL_FCALL.
Definition at line 1030 of file vm_eval.c.
References argc, argv, CALL_FCALL, and CALL_FCALL_KW.
Referenced by rb_eval_cmd_kw(), rb_obj_call_init(), and rb_obj_call_init_kw().
Calls a method.
Same as rb_funcallv but this function can call only public methods.
recv | receiver of the method |
mid | an ID that represents the name of the method |
argc | the number of arguments |
argv | pointer to an array of method arguments |
Definition at line 1137 of file vm_eval.c.
References argc, argv, and CALL_PUBLIC.
Referenced by rb_funcall_passing_block(), rb_funcall_with_block(), and rb_random_ulong_limited().
Definition at line 1143 of file vm_eval.c.
References argc, argv, CALL_PUBLIC, and CALL_PUBLIC_KW.
VALUE rb_iterate | ( | VALUE(*)(VALUE) | it_proc, |
VALUE | data1, | ||
rb_block_call_func_t | bl_proc, | ||
VALUE | data2 | ||
) |
Definition at line 1544 of file vm_eval.c.
Referenced by rb_block_call(), rb_block_call_kw(), and rb_check_block_call().
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_no_method_exception | ( | VALUE | exc, |
VALUE | format, | ||
VALUE | obj, | ||
int | argc, | ||
const VALUE * | argv, | ||
int | priv | ||
) |
Definition at line 886 of file vm_eval.c.
References argc, argv, name, rb_ary_new4, rb_eNoMethodError, rb_fstring_lit, rb_name_err_new(), and rb_nomethod_err_new().
Definition at line 2092 of file vm_eval.c.
References argc, argv, RB_NO_KEYWORDS, and rb_captured_block::self.
Definition at line 2124 of file vm_eval.c.
References argc, argv, RB_NO_KEYWORDS, and rb_captured_block::self.
Definition at line 2315 of file vm_eval.c.
References rb_sym_intern_ascii_cstr, rb_throw_obj(), and rb_vm_tag::tag.
Definition at line 2290 of file vm_eval.c.
References EC_JUMP_TAG, rb_execution_context_struct::errinfo, NULL, numberof, rb_vm_tag::prev, rb_class_new_instance(), rb_exc_raise(), rb_str_new_cstr, rb_vm_tag::retval, rb_vm_tag::tag, rb_execution_context_struct::tag, and TAG_THROW.
Referenced by rb_throw().
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().
VALUE rb_vm_call0 | ( | rb_execution_context_t * | ec, |
VALUE | recv, | ||
ID | id, | ||
int | argc, | ||
const VALUE * | argv, | ||
const rb_callable_method_entry_t * | cme, | ||
int | kw_splat | ||
) |
Definition at line 46 of file vm_eval.c.
References argc, argv, rb_calling_info::block_handler, rb_calling_info::ci, rb_calling_info::kw_splat, NULL, Qfalse, rb_calling_info::recv, VM_CALL_KW_SPLAT, VM_CC_ON_STACK, and VM_CI_ON_STACK.
Referenced by rb_check_funcall_basic_kw(), and rb_vm_call_kw().
VALUE rb_vm_call_kw | ( | rb_execution_context_t * | ec, |
VALUE | recv, | ||
VALUE | id, | ||
int | argc, | ||
const VALUE * | argv, | ||
const rb_callable_method_entry_t * | me, | ||
int | kw_splat | ||
) |
Definition at line 260 of file vm_eval.c.
References argc, argv, and rb_vm_call0().
Referenced by rb_check_funcall_with_hook_kw().
Definition at line 1341 of file vm_eval.c.
Referenced by ossl_generate_cb_2(), rb_ary_delete(), rb_ary_each(), and ruby_float_step().
VALUE rb_yield_block | ( | RB_BLOCK_CALL_FUNC_ARGLIST(val, arg) | ) |
Definition at line 1419 of file vm_eval.c.
References argc, argv, NIL_P, rb_keyword_given_p(), and VM_BLOCK_HANDLER_NONE.
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 1387 of file vm_eval.c.
References NIL_P, RARRAY_CONST_PTR, rb_check_array_type(), rb_eArgError, RB_GC_GUARD, rb_raise(), and rb_callcache::v.
Definition at line 1400 of file vm_eval.c.
References NIL_P, RARRAY_CONST_PTR, rb_check_array_type(), rb_eArgError, RB_GC_GUARD, rb_raise(), and rb_callcache::v.
Definition at line 1804 of file vm_eval.c.
References NULL, rb_str_new2, rb_str_new_cstr, rb_vm_top_self(), and str.
Referenced by rb_eval_string().
VALUE vm_exec | ( | rb_execution_context_t * | ec, |
bool | mjit_enable_p | ||
) |