Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
Macros | Typedefs | Functions
vm.h File Reference

Public APIs related to rb_cRubyVM. More...

#include "ruby/internal/attr/noreturn.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"

Go to the source code of this file.

Macros

#define HAVE_RB_DEFINE_ALLOC_FUNC   1
 

Typedefs

typedef VALUE(* rb_alloc_func_t) (VALUE)
 

Functions

int rb_sourceline (void)
 
const char * rb_sourcefile (void)
 
int rb_frame_method_id_and_class (ID *idp, VALUE *klassp)
 
VALUE rb_check_funcall (VALUE, ID, int, const VALUE *)
 
VALUE rb_check_funcall_kw (VALUE, ID, int, const VALUE *, int)
 
void rb_remove_method (VALUE, const char *)
 
void rb_remove_method_id (VALUE, ID)
 
VALUE rb_eval_cmd_kw (VALUE, VALUE, int)
 
VALUE rb_apply (VALUE, ID, VALUE)
 Calls a method. More...
 
VALUE rb_obj_instance_eval (int, const VALUE *, VALUE)
 
VALUE rb_obj_instance_exec (int, const VALUE *, VALUE)
 
VALUE rb_mod_module_eval (int, const VALUE *, VALUE)
 
VALUE rb_mod_module_exec (int, const VALUE *, VALUE)
 
void rb_define_alloc_func (VALUE, rb_alloc_func_t)
 
void rb_undef_alloc_func (VALUE)
 
rb_alloc_func_t rb_get_alloc_func (VALUE)
 
void rb_clear_constant_cache (void)
 
void rb_clear_method_cache_by_class (VALUE)
 
void rb_alias (VALUE, ID, ID)
 
void rb_attr (VALUE, ID, int, int, int)
 
int rb_method_boundp (VALUE, ID, int)
 
int rb_method_basic_definition_p (VALUE, ID)
 
int rb_obj_respond_to (VALUE, ID, int)
 
int rb_respond_to (VALUE, ID)
 
VALUE rb_f_notimplement (int argc, const VALUE *argv, VALUE obj, VALUE marker)
 
void rb_backtrace (void)
 
VALUE rb_make_backtrace (void)
 

Detailed Description

Public APIs related to rb_cRubyVM.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org
Warning
Symbols prefixed with either RBIMPL or rbimpl are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.
Note
To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance __VA_ARGS__ is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file vm.h.

Macro Definition Documentation

◆ HAVE_RB_DEFINE_ALLOC_FUNC

#define HAVE_RB_DEFINE_ALLOC_FUNC   1

Definition at line 49 of file vm.h.

Typedef Documentation

◆ rb_alloc_func_t

typedef VALUE(* rb_alloc_func_t) (VALUE)

Definition at line 50 of file vm.h.

Function Documentation

◆ rb_alias()

void rb_alias ( VALUE  klass,
ID  alias_name,
ID  original_name 
)

◆ 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 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.

◆ rb_attr()

void rb_attr ( VALUE  klass,
ID  id,
int  read,
int  write,
int  ex 
)

◆ rb_backtrace()

void rb_backtrace ( void  )

Definition at line 1013 of file vm_backtrace.c.

◆ rb_check_funcall()

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

◆ rb_check_funcall_kw()

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

◆ rb_clear_constant_cache()

void rb_clear_constant_cache ( void  )

Definition at line 127 of file vm_method.c.

References INC_GLOBAL_CONSTANT_STATE.

Referenced by rb_const_remove(), and rb_const_set().

◆ rb_clear_method_cache_by_class()

void rb_clear_method_cache_by_class ( VALUE  )

◆ rb_define_alloc_func()

void rb_define_alloc_func ( VALUE  ,
rb_alloc_func_t   
)

◆ rb_eval_cmd_kw()

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

◆ rb_f_notimplement()

VALUE rb_f_notimplement ( int  argc,
const VALUE argv,
VALUE  obj,
VALUE  marker 
)

◆ rb_frame_method_id_and_class()

int rb_frame_method_id_and_class ( ID idp,
VALUE klassp 
)

Definition at line 2446 of file vm.c.

References rb_ec_frame_method_id_and_class().

◆ rb_get_alloc_func()

rb_alloc_func_t rb_get_alloc_func ( VALUE  klass)

Definition at line 960 of file vm_method.c.

References RCLASS_EXT, RCLASS_SUPER, T_CLASS, and UNDEF_ALLOC_FUNC.

◆ rb_make_backtrace()

VALUE rb_make_backtrace ( void  )

Definition at line 1059 of file vm_backtrace.c.

References ALL_BACKTRACE_LINES, BACKTRACE_START, and rb_ec_backtrace_str_ary().

◆ rb_method_basic_definition_p()

int rb_method_basic_definition_p ( VALUE  klass,
ID  id 
)

Definition at line 2439 of file vm_method.c.

References FALSE, METHOD_ENTRY_BASIC, rb_callable_method_entry(), and TRUE.

◆ rb_method_boundp()

int rb_method_boundp ( VALUE  klass,
ID  id,
int  ex 
)

Definition at line 1469 of file vm_method.c.

◆ rb_mod_module_eval()

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

Definition at line 2164 of file vm_eval.c.

References argc, argv, mod, and RB_NO_KEYWORDS.

◆ rb_mod_module_exec()

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

Definition at line 2198 of file vm_eval.c.

References argc, argv, mod, and RB_NO_KEYWORDS.

◆ rb_obj_instance_eval()

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

Definition at line 2092 of file vm_eval.c.

References argc, argv, RB_NO_KEYWORDS, and rb_captured_block::self.

◆ rb_obj_instance_exec()

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

Definition at line 2124 of file vm_eval.c.

References argc, argv, RB_NO_KEYWORDS, and rb_captured_block::self.

◆ rb_obj_respond_to()

int rb_obj_respond_to ( VALUE  obj,
ID  id,
int  priv 
)

Definition at line 2545 of file vm_method.c.

References rb_ec_obj_respond_to().

Referenced by rb_respond_to().

◆ rb_remove_method()

void rb_remove_method ( VALUE  klass,
const char *  name 
)

Definition at line 1357 of file vm_method.c.

References name, and rb_intern().

◆ rb_remove_method_id()

void rb_remove_method_id ( VALUE  klass,
ID  mid 
)

Definition at line 1351 of file vm_method.c.

◆ rb_respond_to()

int rb_respond_to ( VALUE  obj,
ID  id 
)

◆ rb_sourcefile()

const char * rb_sourcefile ( void  )

◆ rb_sourceline()

int rb_sourceline ( void  )

◆ rb_undef_alloc_func()

void rb_undef_alloc_func ( VALUE  klass)