Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Typedefs | Enumerations | Functions
vm_eval.c File Reference

Go to the source code of this file.

Data Structures

struct  rescue_funcall_args
 
struct  iter_method_arg
 
struct  eval_string_from_file_arg
 

Macros

#define NOEX_OK   NOEX_NOSUPER
 
#define type_case(t)   case t: return #t;
 
#define NOEX_MISSING   0x80
 

Typedefs

typedef enum call_type call_type
 

Enumerations

enum  call_type { CALL_PUBLIC, CALL_FCALL, CALL_VCALL, CALL_TYPE_MAX }
 

Functions

static VALUE method_missing (VALUE obj, ID id, int argc, const VALUE *argv, int call_status)
 
static VALUE vm_yield_with_cref (rb_thread_t *th, int argc, const VALUE *argv, const NODE *cref)
 
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, const rb_block_t *blockargptr)
 
static NODEvm_cref_push (rb_thread_t *th, VALUE klass, int noex, rb_block_t *blockptr)
 
static VALUE vm_exec (rb_thread_t *th)
 
static void vm_set_eval_stack (rb_thread_t *th, VALUE iseqval, const NODE *cref, rb_block_t *base_block)
 
static int vm_collect_local_variables_in_heap (rb_thread_t *th, VALUE *dfp, VALUE ary)
 
VALUE rb_vm_backtrace_str_ary (rb_thread_t *th, int lev, int n)
 
static VALUE send_internal (int argc, const VALUE *argv, VALUE recv, call_type scope)
 
static VALUE vm_call0_body (rb_thread_t *th, rb_call_info_t *ci, const VALUE *argv)
 
static VALUE vm_call0 (rb_thread_t *th, VALUE recv, ID id, int argc, const VALUE *argv, const rb_method_entry_t *me, VALUE defined_class)
 
static VALUE vm_call0_cfunc_with_frame (rb_thread_t *th, rb_call_info_t *ci, const VALUE *argv)
 
static VALUE vm_call0_cfunc (rb_thread_t *th, rb_call_info_t *ci, const VALUE *argv)
 
VALUE rb_vm_call (rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_method_entry_t *me, VALUE defined_class)
 
static VALUE vm_call_super (rb_thread_t *th, int argc, const VALUE *argv)
 
VALUE rb_call_super (int argc, const VALUE *argv)
 
static void stack_check (void)
 
static rb_method_entry_trb_search_method_entry (VALUE recv, ID mid, VALUE *defined_class_ptr)
 
static int rb_method_call_status (rb_thread_t *th, const rb_method_entry_t *me, call_type scope, VALUE self)
 
static VALUE rb_call0 (VALUE recv, ID mid, int argc, const VALUE *argv, call_type scope, VALUE self)
 
static VALUE check_funcall_exec (struct rescue_funcall_args *args)
 
static VALUE check_funcall_failed (struct rescue_funcall_args *args, VALUE e)
 
static int check_funcall_respond_to (rb_thread_t *th, VALUE klass, VALUE recv, ID mid)
 
static int check_funcall_callable (rb_thread_t *th, const rb_method_entry_t *me)
 
static VALUE check_funcall_missing (rb_thread_t *th, VALUE klass, VALUE recv, ID mid, int argc, const VALUE *argv)
 
VALUE rb_check_funcall (VALUE recv, ID mid, int argc, const VALUE *argv)
 
VALUE rb_check_funcall_with_hook (VALUE recv, ID mid, int argc, const VALUE *argv, rb_check_funcall_hook *hook, VALUE arg)
 
static const char * rb_type_str (enum ruby_value_type type)
 
static VALUE rb_call (VALUE recv, ID mid, int argc, const VALUE *argv, call_type scope)
 
 NORETURN (static void raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj, int call_status))
 
static VALUE rb_method_missing (int argc, const VALUE *argv, VALUE obj)
 
static VALUE make_no_method_exception (VALUE exc, const char *format, VALUE obj, int argc, const VALUE *argv)
 
static void raise_method_missing (rb_thread_t *th, int argc, const VALUE *argv, VALUE obj, int last_call_status)
 
void rb_raise_method_missing (rb_thread_t *th, int argc, VALUE *argv, VALUE obj, int call_status)
 
VALUE rb_apply (VALUE recv, ID mid, VALUE args)
 Calls a method. More...
 
VALUE rb_funcall (VALUE recv, ID mid, int n,...)
 Calls a method. More...
 
VALUE rb_funcallv (VALUE recv, ID mid, int argc, const VALUE *argv)
 Calls a method. More...
 
VALUE rb_funcallv_public (VALUE recv, ID mid, int argc, const VALUE *argv)
 Calls a method. More...
 
VALUE rb_funcall_passing_block (VALUE recv, ID mid, int argc, const VALUE *argv)
 
VALUE rb_funcall_with_block (VALUE recv, ID mid, int argc, const VALUE *argv, VALUE pass_procval)
 
VALUE rb_f_send (int argc, VALUE *argv, VALUE recv)
 
VALUE rb_f_public_send (int argc, VALUE *argv, VALUE recv)
 
static VALUE rb_yield_0 (int argc, const VALUE *argv)
 
VALUE rb_yield (VALUE val)
 
VALUE rb_yield_values (int n,...)
 
VALUE rb_yield_values2 (int argc, const VALUE *argv)
 
VALUE rb_yield_splat (VALUE values)
 
VALUE rb_yield_block (VALUE val, VALUE arg, int argc, const VALUE *argv, VALUE blockarg)
 
static VALUE loop_i (void)
 
static VALUE rb_f_loop_size (VALUE self, VALUE args, VALUE eobj)
 
static VALUE rb_f_loop (VALUE self)
 
VALUE rb_iterate (VALUE(*it_proc)(VALUE), VALUE data1, VALUE(*bl_proc)(ANYARGS), VALUE data2)
 
static VALUE iterate_method (VALUE obj)
 
VALUE rb_block_call (VALUE obj, ID mid, int argc, const VALUE *argv, VALUE(*bl_proc)(ANYARGS), VALUE data2)
 
static VALUE iterate_check_method (VALUE obj)
 
VALUE rb_check_block_call (VALUE obj, ID mid, int argc, const VALUE *argv, VALUE(*bl_proc)(ANYARGS), VALUE data2)
 
VALUE rb_each (VALUE obj)
 
static VALUE eval_string_with_cref (VALUE self, VALUE src, VALUE scope, NODE *const cref_arg, volatile VALUE file, volatile int line)
 
static VALUE eval_string (VALUE self, VALUE src, VALUE scope, VALUE file, int line)
 
VALUE rb_f_eval (int argc, VALUE *argv, VALUE self)
 
VALUE ruby_eval_string_from_file (const char *str, const char *filename)
 
static VALUE eval_string_from_file_helper (VALUE data)
 
VALUE ruby_eval_string_from_file_protect (const char *str, const char *filename, int *state)
 
VALUE rb_eval_string (const char *str)
 Evaluates the given string in an isolated binding. More...
 
VALUE rb_eval_string_protect (const char *str, int *state)
 Evaluates the given string in an isolated binding. More...
 
VALUE rb_eval_string_wrap (const char *str, int *state)
 Evaluates the given string under a module binding in an isolated binding. More...
 
VALUE rb_eval_cmd (VALUE cmd, VALUE arg, int level)
 
static VALUE yield_under (VALUE under, VALUE self, VALUE values)
 
VALUE rb_yield_refine_block (VALUE refinement, VALUE refinements)
 
static VALUE eval_under (VALUE under, VALUE self, VALUE src, VALUE file, int line)
 
static VALUE specific_eval (int argc, VALUE *argv, VALUE klass, VALUE self)
 
VALUE rb_obj_instance_eval (int argc, VALUE *argv, VALUE self)
 
VALUE rb_obj_instance_exec (int argc, VALUE *argv, VALUE self)
 
VALUE rb_mod_module_eval (int argc, VALUE *argv, VALUE mod)
 
VALUE rb_mod_module_exec (int argc, VALUE *argv, VALUE mod)
 
static VALUE rb_f_throw (int argc, VALUE *argv)
 
void rb_throw_obj (VALUE tag, VALUE value)
 
void rb_throw (const char *tag, VALUE val)
 
static VALUE catch_i (VALUE tag, VALUE data)
 
static VALUE rb_f_catch (int argc, VALUE *argv)
 
VALUE rb_catch (const char *tag, VALUE(*func)(), VALUE data)
 
VALUE rb_catch_obj (VALUE t, VALUE(*func)(), VALUE data)
 
VALUE rb_catch_protect (VALUE t, rb_block_call_func *func, VALUE data, int *stateptr)
 
static VALUE rb_f_local_variables (void)
 
VALUE rb_f_block_given_p (void)
 
VALUE rb_current_realfilepath (void)
 
void Init_vm_eval (void)
 

Macro Definition Documentation

◆ NOEX_MISSING

#define NOEX_MISSING   0x80

Definition at line 639 of file vm_eval.c.

Referenced by method_missing(), raise_method_missing(), and rb_raise_method_missing().

◆ NOEX_OK

#define NOEX_OK   NOEX_NOSUPER

◆ type_case

#define type_case (   t)    case t: return #t;

Referenced by rb_type_str().

Typedef Documentation

◆ call_type

typedef enum call_type call_type

Enumeration Type Documentation

◆ call_type

enum call_type
Enumerator
CALL_PUBLIC 
CALL_FCALL 
CALL_VCALL 
CALL_TYPE_MAX 

Definition at line 26 of file vm_eval.c.

Function Documentation

◆ catch_i()

static VALUE catch_i ( VALUE  tag,
VALUE  data 
)
static

Definition at line 1768 of file vm_eval.c.

References rb_yield_0(), and rb_vm_tag::tag.

Referenced by rb_f_catch().

◆ check_funcall_callable()

static int check_funcall_callable ( rb_thread_t th,
const rb_method_entry_t me 
)
static

◆ check_funcall_exec()

static VALUE check_funcall_exec ( struct rescue_funcall_args args)
static

◆ check_funcall_failed()

static VALUE check_funcall_failed ( struct rescue_funcall_args args,
VALUE  e 
)
static

◆ check_funcall_missing()

static VALUE check_funcall_missing ( rb_thread_t th,
VALUE  klass,
VALUE  recv,
ID  mid,
int  argc,
const VALUE argv 
)
static

◆ check_funcall_respond_to()

static int check_funcall_respond_to ( rb_thread_t th,
VALUE  klass,
VALUE  recv,
ID  mid 
)
static

◆ eval_string()

static VALUE eval_string ( VALUE  self,
VALUE  src,
VALUE  scope,
VALUE  file,
int  line 
)
static

◆ eval_string_from_file_helper()

static VALUE eval_string_from_file_helper ( VALUE  data)
static

◆ eval_string_with_cref()

static VALUE eval_string_with_cref ( VALUE  self,
VALUE  src,
VALUE  scope,
NODE *const  cref_arg,
volatile VALUE  file,
volatile int  line 
)
static

◆ eval_under()

static VALUE eval_under ( VALUE  under,
VALUE  self,
VALUE  src,
VALUE  file,
int  line 
)
static

◆ Init_vm_eval()

void Init_vm_eval ( void  )

◆ iterate_check_method()

static VALUE iterate_check_method ( VALUE  obj)
static

◆ iterate_method()

static VALUE iterate_method ( VALUE  obj)
static

◆ loop_i()

static VALUE loop_i ( void  )
static

Definition at line 1012 of file vm_eval.c.

References Qnil, and rb_yield_0().

Referenced by rb_f_loop().

◆ make_no_method_exception()

static VALUE make_no_method_exception ( VALUE  exc,
const char *  format,
VALUE  obj,
int  argc,
const VALUE argv 
)
static

◆ method_missing()

static VALUE method_missing ( VALUE  obj,
ID  id,
int  argc,
const VALUE argv,
int  call_status 
)
inlinestatic

◆ NORETURN()

NORETURN ( static void   raise_method_missingrb_thread_t *th, int argc, const VALUE *argv, VALUE obj, int call_status)

◆ raise_method_missing()

static void raise_method_missing ( rb_thread_t th,
int  argc,
const VALUE argv,
VALUE  obj,
int  last_call_status 
)
static

◆ rb_apply()

VALUE rb_apply ( VALUE  recv,
ID  mid,
VALUE  args 
)

Calls a method.

Parameters
recvreceiver of the method
midan ID that represents the name of the method
argsan Array object which contains method arguments
Precondition
args must refer an Array object.

Definition at line 752 of file vm_eval.c.

References ALLOCA_N, argc, argv, CALL_FCALL, MEMCPY, OBJ_FREEZE, RARRAY_CONST_PTR, RARRAY_LENINT, RARRAY_PTR, rb_ary_subseq(), rb_call(), RB_GC_GUARD, RBASIC_CLEAR_CLASS, and rescue_funcall_args::recv.

Referenced by ary2list(), ary2list2(), exec_callback(), ip_ruby_cmd_core(), and tk_do_callback().

◆ rb_block_call()

VALUE rb_block_call ( VALUE  obj,
ID  mid,
int  argc,
const VALUE argv,
VALUE(*)(ANYARGS bl_proc,
VALUE  data2 
)

◆ rb_call()

static VALUE rb_call ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv,
call_type  scope 
)
inlinestatic

calls the specified method.

This function is called by functions in rb_call* family.

Parameters
recvreceiver
midan ID that represents the name of the method
argcthe number of method arguments
argva pointer to an array of method arguments
scope

Definition at line 589 of file vm_eval.c.

References argc, argv, rb_thread_struct::cfp, GET_THREAD(), rb_call0(), rescue_funcall_args::recv, and rb_control_frame_struct::self.

Referenced by iterate_method(), rb_apply(), rb_each(), rb_funcall(), rb_funcall_passing_block(), rb_funcall_with_block(), rb_funcallv(), and rb_funcallv_public().

◆ rb_call0()

static VALUE rb_call0 ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv,
call_type  scope,
VALUE  self 
)
inlinestatic

calls the specified method.

This function is called by functions in rb_call* family.

Parameters
recvreceiver of the method
midan ID that represents the name of the method
argcthe number of method arguments
argva pointer to an array of method arguments
scope
selfself in the caller. Qundef means no self is considered and protected methods cannot be called
Note
self is used in order to controlling access to protected methods.

Definition at line 313 of file vm_eval.c.

References argc, argv, GET_THREAD(), method_missing(), NOEX_OK, rb_method_call_status(), rb_search_method_entry(), stack_check(), and vm_call0().

Referenced by rb_call(), and send_internal().

◆ rb_call_super()

VALUE rb_call_super ( int  argc,
const VALUE argv 
)

◆ rb_catch()

VALUE rb_catch ( const char *  tag,
VALUE(*)()  func,
VALUE  data 
)

Definition at line 1825 of file vm_eval.c.

References func, ID2SYM, rb_catch_obj(), rb_cObject, rb_intern, rb_obj_alloc(), and rb_vm_tag::tag.

◆ rb_catch_obj()

VALUE rb_catch_obj ( VALUE  t,
VALUE(*)()  func,
VALUE  data 
)

Definition at line 1832 of file vm_eval.c.

References func, JUMP_TAG, rb_catch_protect(), t(), and val.

Referenced by rb_catch(), and rb_f_catch().

◆ rb_catch_protect()

VALUE rb_catch_protect ( VALUE  t,
rb_block_call_func func,
VALUE  data,
int *  stateptr 
)

◆ rb_check_block_call()

VALUE rb_check_block_call ( VALUE  obj,
ID  mid,
int  argc,
const VALUE argv,
VALUE(*)(ANYARGS bl_proc,
VALUE  data2 
)

◆ rb_check_funcall()

VALUE rb_check_funcall ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv 
)

◆ rb_check_funcall_with_hook()

VALUE rb_check_funcall_with_hook ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv,
rb_check_funcall_hook hook,
VALUE  arg 
)

◆ rb_current_realfilepath()

VALUE rb_current_realfilepath ( void  )

◆ rb_each()

VALUE rb_each ( VALUE  obj)

Definition at line 1182 of file vm_eval.c.

References CALL_FCALL, iter_method_arg::obj, and rb_call().

◆ rb_eval_cmd()

VALUE rb_eval_cmd ( VALUE  cmd,
VALUE  arg,
int  level 
)

◆ rb_eval_string()

VALUE rb_eval_string ( const char *  str)

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.

Parameters
strRuby code to evaluate.
Returns
The evaluated result.
Exceptions
ExceptionRaises an exception on error.

Definition at line 1411 of file vm_eval.c.

References ruby_eval_string_from_file(), and eval_string_from_file_arg::str.

Referenced by foletype_s_typelibs(), ip_ruby_eval(), and rb_eval_string_protect().

◆ rb_eval_string_protect()

VALUE rb_eval_string_protect ( const char *  str,
int *  state 
)

Evaluates the given string in an isolated binding.

FILE will be "(eval)", and LINE starts from 1 in the evaluation.

See also
rb_eval_string
Parameters
strRuby code to evaluate.
stateBeing set to zero if succeeded. Nonzero if an error occurred.
Returns
The evaluated result if succeeded, an undefined value if otherwise.

Definition at line 1427 of file vm_eval.c.

References rb_eval_string(), rb_protect(), and eval_string_from_file_arg::str.

Referenced by ip_ruby_cmd_receiver_const_get(), and rb_eval_string_wrap().

◆ rb_eval_string_wrap()

VALUE rb_eval_string_wrap ( const char *  str,
int *  state 
)

Evaluates the given string under a module binding in an isolated binding.

This is same as the binding for required libraries on "require('foo', true)".

FILE will be "(eval)", and LINE starts from 1 in the evaluation.

See also
rb_eval_string
Parameters
strRuby code to evaluate.
stateBeing set to zero if succeeded. Nonzero if an error occurred.
Returns
The evaluated result if succeeded, an undefined value if otherwise.

Definition at line 1444 of file vm_eval.c.

References GET_THREAD(), JUMP_TAG, rb_eval_string_protect(), rb_extend_object(), rb_module_new(), rb_obj_clone(), rb_vm_top_self(), eval_string_from_file_arg::str, rb_thread_struct::top_self, rb_thread_struct::top_wrapper, and val.

◆ rb_f_block_given_p()

VALUE rb_f_block_given_p ( void  )

◆ rb_f_catch()

static VALUE rb_f_catch ( int  argc,
VALUE argv 
)
static

Definition at line 1811 of file vm_eval.c.

References argc, argv, catch_i(), rb_catch_obj(), rb_cObject, rb_obj_alloc(), rb_scan_args(), and rb_vm_tag::tag.

Referenced by Init_vm_eval().

◆ rb_f_eval()

VALUE rb_f_eval ( int  argc,
VALUE argv,
VALUE  self 
)

Definition at line 1349 of file vm_eval.c.

References argc, argv, eval_string(), NIL_P, NUM2INT, Qundef, rb_scan_args(), SafeStringValue, and StringValue.

Referenced by bind_eval(), and Init_vm_eval().

◆ rb_f_local_variables()

static VALUE rb_f_local_variables ( void  )
static

◆ rb_f_loop()

static VALUE rb_f_loop ( VALUE  self)
static

Definition at line 1046 of file vm_eval.c.

References loop_i(), Qnil, rb_eStopIteration, rb_f_loop_size(), rb_rescue2(), and RETURN_SIZED_ENUMERATOR.

Referenced by Init_vm_eval().

◆ rb_f_loop_size()

static VALUE rb_f_loop_size ( VALUE  self,
VALUE  args,
VALUE  eobj 
)
static

Definition at line 1021 of file vm_eval.c.

References DBL2NUM, and INFINITY.

Referenced by rb_f_loop().

◆ rb_f_public_send()

VALUE rb_f_public_send ( int  argc,
VALUE argv,
VALUE  recv 
)

Definition at line 934 of file vm_eval.c.

References argc, argv, CALL_PUBLIC, rescue_funcall_args::recv, and send_internal().

Referenced by Init_vm_eval().

◆ rb_f_send()

VALUE rb_f_send ( int  argc,
VALUE argv,
VALUE  recv 
)

Definition at line 914 of file vm_eval.c.

References argc, argv, CALL_FCALL, rescue_funcall_args::recv, and send_internal().

Referenced by Init_vm_eval(), and inject_op_i().

◆ rb_f_throw()

static VALUE rb_f_throw ( int  argc,
VALUE argv 
)
static

Definition at line 1730 of file vm_eval.c.

References argc, argv, rb_scan_args(), rb_throw_obj(), and UNREACHABLE.

Referenced by Init_vm_eval().

◆ rb_funcall()

VALUE rb_funcall ( VALUE  recv,
ID  mid,
int  n,
  ... 
)

Calls a method.

Parameters
recvreceiver of the method
midan ID that represents the name of the method
nthe number of arguments
...arbitrary number of method arguments
Precondition
each of arguments after n must be a VALUE.

Definition at line 781 of file vm_eval.c.

References ALLOCA_N, argv, CALL_FCALL, rb_call(), rescue_funcall_args::recv, and va_init_list.

Referenced by _thread_call_proc_core(), _thread_call_proc_value(), add(), argument_error(), ary2list(), ary2list2(), BigDecimal_power(), BigDecimal_to_i(), BigDecimal_to_r(), binop(), bsock_setsockopt(), call_next(), call_queue_handler(), callback(), cbsubst_def_attr_aliases(), cbsubst_get_subst_key(), cbsubst_scan_args(), chunk_i(), chunk_ii(), cmp(), cmp_ge(), cmp_gt(), cmp_le(), cmp_lt(), coerce_body(), const_missing(), convert_encoding(), copy_stream_fallback_body(), cParser_initialize(), create_encoding_table(), cState_aref(), cState_aset(), cState_from_state_s(), default_inspect(), dir_inspect(), divmodv(), DupPrivPKeyPtr(), encoding_table_get_name_core(), enum_cycle_size(), enum_each_cons_size(), enum_each_slice_size(), enum_find(), enum_zip(), eq(), eval_queue_handler(), evs_length(), exc_message(), f_add(), f_cmp(), f_div(), f_eqeq_p(), f_ge_p(), f_gt_p(), f_le_p(), f_lt_p(), f_minus_one_p(), f_mul(), f_negative_p(), f_odd_p(), f_one_p(), f_sub(), f_to_f(), f_zero_p(), fix_and(), fix_or(), fix_pow(), fix_xor(), flo_pow(), flo_quo(), fole_s_show_help(), foleparam_inspect(), foletype_s_ole_classes(), foletypelib_s_typelibs(), folevariable_inspect(), folevariant_value(), fun1(), fun2(), function_call(), generate_json(), generate_json_bignum(), generate_json_float(), generate_json_object(), generate_json_string(), generic_to_value(), get_backtrace(), get_eval_string_core(), GetConfigPtr(), GetPrivPKeyPtr(), GetVpValueWithPrec(), grep_i(), grep_iter_i(), gzfile_close(), gzfile_read_raw_partial(), gzfile_read_raw_rescue(), gzfile_reader_rewind(), gzfile_write_raw(), hash_default_value(), hidden_identity_hash_new(), Init_generator(), Init_parser(), Init_syslog(), Init_win32ole(), initialize(), inject_op_i(), int_dotimes(), int_dotimes_size(), int_downto(), int_even_p(), int_odd_p(), int_round_0(), int_upto(), invoke_queue_handler(), io_reader(), io_write(), ip_eval(), ip_invoke_with_position(), ip_set_exc_message(), is_negative(), is_one(), is_zero(), JSON_parse_array(), JSON_parse_object(), JSON_parse_string(), key2keyname(), lazy_drop_size(), lazy_flat_map_func(), lazy_flat_map_to_ary(), lazy_grep_func(), lazy_grep_iter(), lazy_map_func(), lazy_reject_func(), lazy_select_func(), lazy_zip_arrays_func(), lazy_zip_func(), lexer_iter(), lib_eventloop_launcher(), lib_fromUTF8_core(), lib_set_system_encoding(), lib_thread_callback(), lib_toUTF8_core(), lib_watchdog_core(), load_file_internal(), make_exception(), make_no_method_exception(), match_i(), max_by_i(), max_i(), min_by_i(), min_i(), minmax_by_i(), minmax_by_i_update(), minmax_i(), minmax_i_update(), mlambda(), mnew_from_me(), mObject_to_json(), mod(), mString_Extend_json_create(), mString_included_s(), mString_to_json_raw_object(), mul(), negate_lit(), negative_int_p(), num_abs(), num_div(), num_equal(), num_fdiv(), num_modulo(), num_nonzero_p(), num_remainder(), num_step(), num_to_int(), num_uminus(), numeric_quo(), nurat_div(), ole_invoke(), ole_typelib_from_itypeinfo(), ossl_call_client_cert_cb(), ossl_call_session_get_cb(), ossl_call_session_new_cb(), ossl_call_session_remove_cb(), ossl_call_tmp_dh_callback(), ossl_call_verify_cb_proc(), ossl_pkey_sign(), ossl_ssl_close(), ossl_ssl_initialize(), ossl_ssl_read_internal(), ossl_ssl_session_get_time(), ossl_ssl_session_set_time(), ossl_ssl_write_internal(), ossl_sslctx_flush_sessions(), ossl_to_der(), ossl_x509attr_get_value(), ossl_x509attr_initialize(), ossl_x509ext_initialize(), ossl_x509store_verify(), parse(), parse_main(), path_atime(), path_basename(), path_blockdev_p(), path_chardev_p(), path_chmod(), path_chown(), path_ctime(), path_directory_p(), path_dirname(), path_entries(), path_executable_p(), path_executable_real_p(), path_exist_p(), path_expand_path(), path_extname(), path_file_p(), path_fnmatch(), path_ftype(), path_grpowned_p(), path_lchmod(), path_lchown(), path_lstat(), path_make_link(), path_make_symlink(), path_mkdir(), path_mtime(), path_owned_p(), path_pipe_p(), path_readable_p(), path_readable_real_p(), path_readlink(), path_realdirpath(), path_realpath(), path_rename(), path_rmdir(), path_s_getwd(), path_setgid_p(), path_setuid_p(), path_size(), path_size_p(), path_socket_p(), path_split(), path_stat(), path_sticky_p(), path_symlink_p(), path_truncate(), path_utime(), path_world_readable_p(), path_world_writable_p(), path_writable_p(), path_writable_real_p(), path_zero_p(), positive_int_p(), protected_alias(), protected_empty(), protected_end_document(), protected_end_mapping(), protected_end_sequence(), protected_end_stream(), protected_start_stream(), quo(), r_le(), r_lt(), r_post_proc(), range_bsearch(), range_check(), range_each_func(), range_eqq(), range_max(), range_min(), range_step(), range_step_size(), rb_big_pow(), rb_class_inherited(), rb_cmpint(), rb_digest_class_s_digest(), rb_digest_instance_bubblebabble(), rb_digest_instance_digest(), rb_digest_instance_digest_bang(), rb_digest_instance_hexdigest(), rb_digest_instance_hexdigest_bang(), rb_digest_instance_length(), rb_digest_instance_new(), rb_digest_instance_to_s(), rb_enc_get_index(), rb_eql(), rb_equal(), rb_exc_new(), rb_exc_new_str(), rb_gzreader_initialize(), rb_gzwriter_flush(), rb_gzwriter_initialize(), rb_hash_default(), rb_inspect(), rb_int_pred(), rb_int_succ(), rb_io_flush_raw(), rb_mod_include(), rb_mod_prepend(), rb_num_coerce_bin(), rb_num_coerce_bit(), rb_num_coerce_cmp(), rb_num_coerce_relop(), rb_obj_as_string(), rb_obj_clone(), rb_obj_dup(), rb_obj_extend(), rb_obj_init_dup_clone(), rb_obj_not_equal(), rb_obj_not_match(), rb_range_values(), rb_str_match(), rb_str_sum(), rb_str_upto(), rb_strftime_with_timespec(), rbtime2vtdate(), reachable_object_from_root_i(), reachable_objects_from_root(), readline_attempted_completion_function(), reduce0(), rescue_callback(), rt_complete_frags(), ruby_num_interval_step_size(), set_backtrace(), set_max_block_time(), set_option_encoding_once(), set_state_ivars(), shift(), slicebefore_i(), slicebefore_ii(), sockopt_unpack(), sort_by_cmp(), ssl_renegotiation_cb(), step_i(), strscan_get_charpos(), sub(), sym_step_i(), syserr_eqq(), tcl2rb_bool(), tcl_protect_core(), time_timespec(), timetick2integer(), tk_funcall(), tk_install_cmd_core(), TkStringValue(), to_strkey(), transcode_io(), unknown_keyword_error(), unlink_body(), unlink_rescue(), vtdate2rbtime(), wadd(), wcmp(), wdivmod(), weq(), wmul(), wquo(), writer(), and wsub().

◆ rb_funcall_passing_block()

VALUE rb_funcall_passing_block ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv 
)

◆ rb_funcall_with_block()

VALUE rb_funcall_with_block ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv,
VALUE  pass_procval 
)

◆ rb_funcallv()

VALUE rb_funcallv ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv 
)

Calls a method.

Parameters
recvreceiver of the method
midan ID that represents the name of the method
argcthe number of arguments
argvpointer to an array of method arguments

Definition at line 812 of file vm_eval.c.

References argc, argv, CALL_FCALL, rb_call(), and rescue_funcall_args::recv.

Referenced by binomial_coefficient(), cmp_eq_recursive(), descending_factorial(), dump_output(), hash_recursive(), rb_ary_bsearch(), rb_ary_cycle_size(), rb_ary_repeated_permutation_size(), rb_io_write(), recursive_cmp(), and sort_2().

◆ rb_funcallv_public()

VALUE rb_funcallv_public ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv 
)

Calls a method.

Same as rb_funcall2 but this function can call only public methods.

Parameters
recvreceiver of the method
midan ID that represents the name of the method
argcthe number of arguments
argvpointer to an array of method arguments

Definition at line 827 of file vm_eval.c.

References argc, argv, CALL_PUBLIC, rb_call(), and rescue_funcall_args::recv.

◆ rb_iterate()

VALUE rb_iterate ( VALUE(*)(VALUE it_proc,
VALUE  data1,
VALUE(*)(ANYARGS bl_proc,
VALUE  data2 
)

◆ rb_method_call_status()

static int rb_method_call_status ( rb_thread_t th,
const rb_method_entry_t me,
call_type  scope,
VALUE  self 
)
inlinestatic

◆ rb_method_missing()

static VALUE rb_method_missing ( int  argc,
const VALUE argv,
VALUE  obj 
)
static

◆ rb_mod_module_eval()

VALUE rb_mod_module_eval ( int  argc,
VALUE argv,
VALUE  mod 
)

Definition at line 1684 of file vm_eval.c.

References argc, argv, mod, and specific_eval().

Referenced by Init_vm_eval(), and rb_struct_s_def().

◆ rb_mod_module_exec()

VALUE rb_mod_module_exec ( int  argc,
VALUE argv,
VALUE  mod 
)

Definition at line 1712 of file vm_eval.c.

References argc, argv, mod, rb_ary_new4, and yield_under().

Referenced by Init_vm_eval(), and rb_mod_initialize().

◆ rb_obj_instance_eval()

VALUE rb_obj_instance_eval ( int  argc,
VALUE argv,
VALUE  self 
)

◆ rb_obj_instance_exec()

VALUE rb_obj_instance_exec ( int  argc,
VALUE argv,
VALUE  self 
)

◆ rb_raise_method_missing()

void rb_raise_method_missing ( rb_thread_t th,
int  argc,
VALUE argv,
VALUE  obj,
int  call_status 
)

Definition at line 736 of file vm_eval.c.

References argc, argv, NOEX_MISSING, rb_thread_struct::passed_block, and raise_method_missing().

Referenced by vm_call_method().

◆ rb_search_method_entry()

static rb_method_entry_t * rb_search_method_entry ( VALUE  recv,
ID  mid,
VALUE defined_class_ptr 
)
inlinestatic

◆ rb_throw()

void rb_throw ( const char *  tag,
VALUE  val 
)

Definition at line 1762 of file vm_eval.c.

References ID2SYM, rb_intern, rb_throw_obj(), rb_vm_tag::tag, and val.

◆ rb_throw_obj()

void rb_throw_obj ( VALUE  tag,
VALUE  value 
)

◆ rb_type_str()

static const char* rb_type_str ( enum ruby_value_type  type)
static

◆ rb_vm_backtrace_str_ary()

VALUE rb_vm_backtrace_str_ary ( rb_thread_t th,
int  lev,
int  n 
)

Referenced by eval_string_with_cref().

◆ rb_vm_call()

VALUE rb_vm_call ( rb_thread_t th,
VALUE  recv,
VALUE  id,
int  argc,
const VALUE argv,
const rb_method_entry_t me,
VALUE  defined_class 
)

Definition at line 244 of file vm_eval.c.

References argc, argv, and vm_call0().

Referenced by rb_method_call_with_block().

◆ rb_yield()

VALUE rb_yield ( VALUE  val)

Definition at line 948 of file vm_eval.c.

References Qundef, rb_yield_0(), and val.

Referenced by ary_add_hash_by(), ary_reject(), ary_reject_bang(), BigDecimal_save_exception_mode(), BigDecimal_save_limit(), BigDecimal_save_rounding_mode(), chdir_yield(), console_cooked(), console_noecho(), console_raw(), cycle_i(), d_lite_downto(), d_lite_step(), d_lite_upto(), dir_each(), dir_s_open(), drop_while_i(), each_cons_i(), each_entry_i(), each_i(), each_key_i(), each_pair_i(), each_slice_i(), each_val_i(), each_value_i(), enum_cycle(), enum_each_slice(), enum_reverse_each(), env_delete_m(), env_each_key(), env_each_pair(), env_each_value(), env_fetch(), fdbm_delete(), fdbm_delete_if(), fdbm_each_key(), fdbm_each_pair(), fdbm_each_value(), fdbm_fetch(), fdbm_s_open(), fdbm_select(), fgdbm_delete_if(), fgdbm_each_key(), fgdbm_each_pair(), fgdbm_each_value(), fgdbm_fetch(), fgdbm_s_open(), fgdbm_select(), find_all_i(), find_i(), fsdbm_delete(), fsdbm_delete_if(), fsdbm_each_key(), fsdbm_each_pair(), fsdbm_each_value(), fsdbm_fetch(), fsdbm_s_open(), fsdbm_select(), glob_i(), grep_iter_i(), group_by_i(), gzfile_wrap(), hist_each(), int_dotimes(), int_downto(), int_upto(), io_s_foreach(), lazy_grep_iter(), lazy_reject_func(), lazy_select_func(), max_by_i(), min_by_i(), minmax_by_i(), mSyslog_open(), num_step(), ole_each_sub(), os_obj_of_i(), ossl_asn1_decode0(), ossl_generate_cb(), ossl_pem_passwd_cb0(), p_gid_switch(), p_uid_switch(), partition_i(), pty_getpty(), pty_open(), range_each(), range_step(), rb_ary_bsearch(), rb_ary_collect(), rb_ary_collect_bang(), rb_ary_combination(), rb_ary_count(), rb_ary_cycle(), rb_ary_delete(), rb_ary_drop_while(), rb_ary_each(), rb_ary_each_index(), rb_ary_fetch(), rb_ary_fill(), rb_ary_index(), rb_ary_initialize(), rb_ary_permutation(), rb_ary_product(), rb_ary_repeated_combination(), rb_ary_repeated_permutation(), rb_ary_reverse_each(), rb_ary_rindex(), rb_ary_select(), rb_ary_select_bang(), rb_ary_take_while(), rb_ary_zip(), rb_callcc(), rb_dlhandle_initialize(), rb_f_open(), rb_fiddle_handle_initialize(), rb_gzreader_each(), rb_gzreader_each_byte(), rb_gzreader_each_char(), rb_hash_delete(), rb_hash_fetch_m(), rb_io_each_byte(), rb_io_each_char(), rb_io_each_codepoint(), rb_io_each_line(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_mutex_synchronize_m(), rb_obj_tap(), rb_reg_match_m(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_match_m(), rb_str_scan(), rb_str_scrub(), rb_str_sub_bang(), rb_str_upto(), rb_struct_each(), rb_struct_each_pair(), rb_struct_select(), rb_thread_s_handle_interrupt(), reject_i(), ruby_float_step(), sort_by_i(), step_i(), str_gsub(), strio_each(), strio_each_byte(), strio_each_char(), strio_each_codepoint(), strio_s_open(), sym_each_i(), sym_step_i(), trace_object_allocations(), tracepoint_disable_m(), tracepoint_enable_m(), wmap_each_key_i(), wmap_each_value_i(), yield_indexed_values(), zip_ary(), zip_i(), zstream_detach_buffer(), and zstream_expand_buffer().

◆ rb_yield_0()

static VALUE rb_yield_0 ( int  argc,
const VALUE argv 
)
inlinestatic

Definition at line 942 of file vm_eval.c.

References argc, argv, GET_THREAD(), and vm_yield().

Referenced by catch_i(), loop_i(), rb_yield(), rb_yield_splat(), rb_yield_values(), and rb_yield_values2().

◆ rb_yield_block()

VALUE rb_yield_block ( VALUE  val,
VALUE  arg,
int  argc,
const VALUE argv,
VALUE  blockarg 
)

Definition at line 1000 of file vm_eval.c.

References argc, argv, rb_proc_t::block, GET_THREAD(), GetProcPtr, NIL_P, and vm_yield_with_block().

◆ rb_yield_refine_block()

VALUE rb_yield_refine_block ( VALUE  refinement,
VALUE  refinements 
)

◆ rb_yield_splat()

VALUE rb_yield_splat ( VALUE  values)

◆ rb_yield_values()

VALUE rb_yield_values ( int  n,
  ... 
)

◆ rb_yield_values2()

VALUE rb_yield_values2 ( int  argc,
const VALUE argv 
)

◆ ruby_eval_string_from_file()

VALUE ruby_eval_string_from_file ( const char *  str,
const char *  filename 
)
Note
This function name is not stable.

Definition at line 1371 of file vm_eval.c.

References eval_string(), Qnil, rb_str_new2, rb_str_new_cstr(), and rb_vm_top_self().

Referenced by rb_eval_string().

◆ ruby_eval_string_from_file_protect()

VALUE ruby_eval_string_from_file_protect ( const char *  str,
const char *  filename,
int *  state 
)

◆ send_internal()

static VALUE send_internal ( int  argc,
const VALUE argv,
VALUE  recv,
call_type  scope 
)
static

◆ specific_eval()

static VALUE specific_eval ( int  argc,
VALUE argv,
VALUE  klass,
VALUE  self 
)
static

◆ stack_check()

static void stack_check ( void  )
inlinestatic

◆ vm_call0()

static VALUE vm_call0 ( rb_thread_t th,
VALUE  recv,
ID  id,
int  argc,
const VALUE argv,
const rb_method_entry_t me,
VALUE  defined_class 
)
static

◆ vm_call0_body()

static VALUE vm_call0_body ( rb_thread_t th,
rb_call_info_t ci,
const VALUE argv 
)
static

◆ vm_call0_cfunc()

static VALUE vm_call0_cfunc ( rb_thread_t th,
rb_call_info_t ci,
const VALUE argv 
)
static

Definition at line 133 of file vm_eval.c.

References argv, and vm_call0_cfunc_with_frame().

Referenced by vm_call0_body().

◆ vm_call0_cfunc_with_frame()

static VALUE vm_call0_cfunc_with_frame ( rb_thread_t th,
rb_call_info_t ci,
const VALUE argv 
)
static

◆ vm_call_super()

static VALUE vm_call_super ( rb_thread_t th,
int  argc,
const VALUE argv 
)
inlinestatic

◆ vm_collect_local_variables_in_heap()

static int vm_collect_local_variables_in_heap ( rb_thread_t th,
VALUE dfp,
VALUE  ary 
)
static

Referenced by rb_f_local_variables().

◆ vm_cref_push()

static NODE* vm_cref_push ( rb_thread_t th,
VALUE  klass,
int  noex,
rb_block_t blockptr 
)
static

◆ vm_exec()

static VALUE vm_exec ( rb_thread_t th)
static

◆ vm_set_eval_stack()

static void vm_set_eval_stack ( rb_thread_t th,
VALUE  iseqval,
const NODE cref,
rb_block_t base_block 
)
static

Referenced by eval_string_with_cref().

◆ vm_yield()

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

Referenced by rb_yield_0().

◆ vm_yield_with_block()

static VALUE vm_yield_with_block ( rb_thread_t th,
int  argc,
const VALUE argv,
const rb_block_t blockargptr 
)
inlinestatic

Referenced by rb_yield_block().

◆ vm_yield_with_cref()

static VALUE vm_yield_with_cref ( rb_thread_t th,
int  argc,
const VALUE argv,
const NODE cref 
)
inlinestatic

◆ yield_under()

static VALUE yield_under ( VALUE  under,
VALUE  self,
VALUE  values 
)
static