Ruby  2.7.2p137(2020-10-01revision5445e0435260b449decf2ac16f9d09bae3cafe72)
Data Structures | Macros | Typedefs | Enumerations | Functions
vm_eval.c File Reference

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, CALL_PUBLIC, CALL_FCALL,
  CALL_VCALL, CALL_PUBLIC_KW, CALL_FCALL_KW, CALL_TYPE_MAX
}
 

Functions

VALUE vm_exec (rb_execution_context_t *ec, int mjit_enable_p)
 
MJIT_FUNC_EXPORTED VALUE rb_vm_call0 (rb_execution_context_t *ec, VALUE recv, ID id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat)
 
MJIT_FUNC_EXPORTED VALUE rb_adjust_argv_kw_splat (int *argc, const VALUE **argv, int *kw_splat)
 
MJIT_FUNC_EXPORTED 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)
 
VALUE rb_call_super_kw (int argc, const VALUE *argv, int kw_splat)
 
VALUE rb_call_super (int argc, const VALUE *argv)
 
VALUE rb_current_receiver (void)
 
VALUE rb_check_funcall_kw (VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
 
VALUE rb_check_funcall (VALUE recv, ID mid, int argc, const VALUE *argv)
 
VALUE rb_check_funcall_default (VALUE recv, ID mid, int argc, const VALUE *argv, VALUE def)
 
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)
 
VALUE rb_check_funcall_with_hook (VALUE recv, ID mid, int argc, const VALUE *argv, rb_check_funcall_hook *hook, VALUE arg)
 
const charrb_type_str (enum ruby_value_type type)
 
 NORETURN (static void uncallable_object(VALUE recv, ID mid))
 
 NORETURN (static void raise_method_missing(rb_execution_context_t *ec, int argc, const VALUE *argv, VALUE obj, enum method_missing_reason call_status))
 
MJIT_FUNC_EXPORTED VALUE rb_make_no_method_exception (VALUE exc, VALUE format, VALUE obj, int argc, const VALUE *argv, int priv)
 
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_kw (VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
 
VALUE rb_funcallv_public (VALUE recv, ID mid, int argc, const VALUE *argv)
 Calls a method. More...
 
VALUE rb_funcallv_public_kw (VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
 
VALUE rb_funcall_passing_block (VALUE recv, ID mid, int argc, const VALUE *argv)
 
VALUE rb_funcall_passing_block_kw (VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat)
 
VALUE rb_funcall_with_block (VALUE recv, ID mid, int argc, const VALUE *argv, VALUE passed_procval)
 
VALUE rb_funcall_with_block_kw (VALUE recv, ID mid, int argc, const VALUE *argv, VALUE passed_procval, int kw_splat)
 
VALUE rb_f_send (int argc, VALUE *argv, VALUE recv)
 
VALUE rb_yield_1 (VALUE val)
 
VALUE rb_yield (VALUE val)
 
VALUE rb_yield_values (int n,...)
 
VALUE rb_yield_values2 (int argc, const VALUE *argv)
 
VALUE rb_yield_values_kw (int argc, const VALUE *argv, int kw_splat)
 
VALUE rb_yield_splat (VALUE values)
 
VALUE rb_yield_splat_kw (VALUE values, int kw_splat)
 
VALUE rb_yield_force_blockarg (VALUE values)
 
VALUE rb_yield_block (RB_BLOCK_CALL_FUNC_ARGLIST(val, arg))
 
VALUE rb_iterate (VALUE(*it_proc)(VALUE), VALUE data1, rb_block_call_func_t bl_proc, VALUE data2)
 
VALUE rb_block_call (VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t bl_proc, VALUE data2)
 
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)
 
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)
 
VALUE rb_check_block_call (VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t bl_proc, VALUE data2)
 
VALUE rb_each (VALUE obj)
 
void rb_parser_warn_location (VALUE, int)
 
VALUE rb_f_eval (int argc, const VALUE *argv, VALUE self)
 
VALUE ruby_eval_string_from_file (const char *str, const char *filename)
 
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 *pstate)
 Evaluates the given string in an isolated binding. More...
 
VALUE rb_eval_string_wrap (const char *str, int *pstate)
 Evaluates the given string under a module binding in an isolated binding. More...
 
VALUE rb_eval_cmd_kw (VALUE cmd, VALUE arg, int kw_splat)
 
VALUE rb_eval_cmd (VALUE cmd, VALUE arg, int _level)
 
VALUE rb_yield_refine_block (VALUE refinement, VALUE refinements)
 
VALUE rb_obj_instance_eval (int argc, const VALUE *argv, VALUE self)
 
VALUE rb_obj_instance_exec (int argc, const VALUE *argv, VALUE self)
 
VALUE rb_mod_module_eval (int argc, const VALUE *argv, VALUE mod)
 
VALUE rb_mod_module_exec (int argc, const VALUE *argv, VALUE mod)
 
void rb_throw_obj (VALUE tag, VALUE value)
 
void rb_throw (const char *tag, VALUE val)
 
VALUE rb_catch (const char *tag, rb_block_call_func_t func, VALUE data)
 
VALUE rb_catch_protect (VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr)
 
VALUE rb_catch_obj (VALUE t, rb_block_call_func_t func, VALUE data)
 
VALUE rb_current_realfilepath (void)
 
void Init_vm_eval (void)
 

Macro Definition Documentation

◆ id_mesg

#define id_mesg   idMesg

Definition at line 29 of file vm_eval.c.

◆ type_case

#define type_case (   t)    t: return #t

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_PUBLIC_KW 
CALL_FCALL_KW 
CALL_TYPE_MAX 
CALL_PUBLIC 
CALL_FCALL 
CALL_VCALL 
CALL_PUBLIC_KW 
CALL_FCALL_KW 
CALL_TYPE_MAX 

Definition at line 31 of file vm_eval.c.

Function Documentation

◆ Init_vm_eval()

void Init_vm_eval ( void  )

Definition at line 2472 of file vm_eval.c.

References rb_define_global_function(), and rb_f_eval().

◆ NORETURN() [1/2]

NORETURN ( static void   raise_method_missingrb_execution_context_t *ec, int argc, const VALUE *argv, VALUE obj, enum method_missing_reason call_status)

◆ NORETURN() [2/2]

NORETURN ( static void   uncallable_objectVALUE recv, ID mid)

◆ rb_adjust_argv_kw_splat()

MJIT_FUNC_EXPORTED VALUE rb_adjust_argv_kw_splat ( int argc,
const VALUE **  argv,
int kw_splat 
)

◆ 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 890 of file vm_eval.c.

References argc, argv, OBJ_FREEZE, RARRAY_LENINT, rb_ary_subseq, and RBASIC_CLEAR_CLASS.

◆ rb_catch_protect()

VALUE rb_catch_protect ( VALUE  t,
rb_block_call_func func,
VALUE  data,
enum ruby_tag_type stateptr 
)

Definition at line 2326 of file vm_eval.c.

◆ rb_check_block_call()

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 1528 of file vm_eval.c.

References arg, argc, argv, iter_method_arg::mid, obj, and rb_iterate().

◆ rb_check_funcall()

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

Definition at line 505 of file vm_eval.c.

Referenced by rb_get_message(), rb_iseq_load_iseq(), and rb_range_values().

◆ rb_check_funcall_default()

VALUE rb_check_funcall_default ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv,
VALUE  def 
)

Definition at line 533 of file vm_eval.c.

Referenced by rb_get_path_check_to_string().

◆ rb_check_funcall_kw()

VALUE rb_check_funcall_kw ( VALUE  recv,
ID  mid,
int  argc,
const VALUE argv,
int  kw_splat 
)

Definition at line 499 of file vm_eval.c.

◆ 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_check_funcall_with_hook_kw()

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 
)

◆ rb_current_realfilepath()

VALUE rb_current_realfilepath ( void  )

Definition at line 2462 of file vm_eval.c.

References cfp, rb_execution_context_struct::cfp, and GET_EC.

Referenced by rb_f_require_relative().

◆ rb_eval_cmd()

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

Definition at line 1824 of file vm_eval.c.

References arg, rb_eval_cmd_kw(), RB_NO_KEYWORDS, and rb_warn().

◆ rb_eval_cmd_kw()

VALUE rb_eval_cmd_kw ( VALUE  cmd,
VALUE  arg,
int  kw_splat 
)

◆ rb_f_eval()

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

Definition at line 1670 of file vm_eval.c.

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

Referenced by Init_vm_eval().

◆ rb_f_send()

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

Definition at line 1188 of file vm_eval.c.

◆ rb_lambda_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 1501 of file vm_eval.c.

References arg, argc, argv, max_argc, min_argc, obj, rb_eArgError, rb_raise(), and rb_vm_ifunc_new().

◆ rb_make_no_method_exception()

MJIT_FUNC_EXPORTED VALUE rb_make_no_method_exception ( VALUE  exc,
VALUE  format,
VALUE  obj,
int  argc,
const VALUE argv,
int  priv 
)

◆ rb_mod_module_eval()

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

Definition at line 2069 of file vm_eval.c.

◆ rb_mod_module_exec()

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

Definition at line 2103 of file vm_eval.c.

◆ rb_obj_instance_eval()

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

Definition at line 1997 of file vm_eval.c.

References klass.

◆ rb_obj_instance_exec()

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

Definition at line 2029 of file vm_eval.c.

References klass.

◆ rb_parser_warn_location()

void rb_parser_warn_location ( VALUE  ,
int   
)

Definition at line 19029 of file ripper.c.

References TypedData_Get_Struct.

◆ rb_throw()

void rb_throw ( const char tag,
VALUE  val 
)

Definition at line 2220 of file vm_eval.c.

References rb_sym_intern_ascii_cstr, rb_throw_obj(), and rb_vm_tag::tag.

◆ rb_throw_obj()

void rb_throw_obj ( VALUE  tag,
VALUE  value 
)

◆ rb_type_str()

const char* rb_type_str ( enum ruby_value_type  type)

◆ rb_vm_call0()

MJIT_FUNC_EXPORTED VALUE rb_vm_call0 ( rb_execution_context_t ec,
VALUE  recv,
ID  id,
int  argc,
const VALUE argv,
const rb_callable_method_entry_t me,
int  kw_splat 
)

◆ rb_vm_call_kw()

MJIT_FUNC_EXPORTED 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 265 of file vm_eval.c.

References argc, argv, me, rb_adjust_argv_kw_splat(), rb_free_tmp_buffer(), rb_vm_call0(), and v.

◆ rb_yield_1()

VALUE rb_yield_1 ( VALUE  val)

Definition at line 1231 of file vm_eval.c.

◆ rb_yield_block()

VALUE rb_yield_block ( RB_BLOCK_CALL_FUNC_ARGLIST(val, arg )

Definition at line 1315 of file vm_eval.c.

References argc, argv, rb_adjust_argv_kw_splat(), RB_PASS_CALLED_KEYWORDS, and v.

◆ rb_yield_force_blockarg()

VALUE rb_yield_force_blockarg ( VALUE  values)

Definition at line 1309 of file vm_eval.c.

◆ rb_yield_refine_block()

VALUE rb_yield_refine_block ( VALUE  refinement,
VALUE  refinements 
)

Definition at line 1885 of file vm_eval.c.

References block_handler, and GET_EC.

◆ 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 1696 of file vm_eval.c.

References rb_str_new_cstr.

Referenced by rb_eval_string().

◆ vm_exec()

VALUE vm_exec ( rb_execution_context_t ec,
int  mjit_enable_p 
)

Definition at line 1909 of file vm.c.