vm_insnhelper.c File Reference
`#include "insns.inc"`
`#include <math.h>`
`#include "constant.h"`
`#include "internal.h"`

Go to the source code of this file.

## Macros

#define | INLINE inline
#define | COLLECT_PROFILE 0
#define | VM_CALLEE_SETUP_ARG(ret, th, iseq, orig_argc, orig_argv, block)
#define | USE_IC_FOR_IVAR 1

## Functions

static rb_control_frame_t * | vm_get_ruby_level_caller_cfp (rb_thread_t *th, rb_control_frame_t *cfp)
static rb_control_frame_t * | vm_push_frame (rb_thread_t *th, const rb_iseq_t *iseq, VALUE type, VALUE self, VALUE specval, const VALUE *pc, VALUE *sp, VALUE *lfp, int local_size)
static void | vm_pop_frame (rb_thread_t *th)
| NORETURN (static void argument_error(const rb_iseq_t *iseq, int miss_argc, int correct_argc))
static void | argument_error (const rb_iseq_t *iseq, int miss_argc, int correct_argc)
static int | vm_callee_setup_arg_complex (rb_thread_t *th, const rb_iseq_t *iseq, int orig_argc, VALUE *orig_argv, const rb_block_t **block)
static int | caller_setup_args (const rb_thread_t *th, rb_control_frame_t *cfp, VALUE flag, int argc, rb_iseq_t *blockiseq, rb_block_t **block)
static VALUE | call_cfunc (VALUE(*func)(), VALUE recv, int len, int argc, const VALUE *argv)
static VALUE | vm_call_cfunc (rb_thread_t *th, rb_control_frame_t *reg_cfp, int num, volatile VALUE recv, const rb_block_t *blockptr, const rb_method_entry_t *me)
static VALUE | vm_call_bmethod (rb_thread_t *th, VALUE recv, int argc, const VALUE *argv, const rb_block_t *blockptr, const rb_method_entry_t *me)
static void | vm_method_missing_args (rb_thread_t *th, VALUE *argv, int num, const rb_block_t *blockptr, int opt)
static VALUE | vm_method_missing (rb_thread_t *th, ID id, VALUE recv, int num, const rb_block_t *blockptr, int opt)
static void | vm_setup_method (rb_thread_t *th, rb_control_frame_t *cfp, VALUE recv, int argc, const rb_block_t *blockptr, VALUE flag, const rb_method_entry_t *me)
static VALUE | vm_call_method (rb_thread_t *th, rb_control_frame_t *cfp, int num, const rb_block_t *blockptr, VALUE flag, ID id, const rb_method_entry_t *me, VALUE recv)
static int | block_proc_is_lambda (const VALUE procval)
static VALUE | vm_yield_with_cfunc (rb_thread_t *th, const rb_block_t *block, VALUE self, int argc, const VALUE *argv, const rb_block_t *blockargptr)
static int | vm_yield_setup_block_args_complex (rb_thread_t *th, const rb_iseq_t *iseq, int argc, VALUE *argv)
static int | vm_yield_setup_block_args (rb_thread_t *th, const rb_iseq_t *iseq, int orig_argc, VALUE *argv, const rb_block_t *blockptr)
static int | vm_yield_setup_args (rb_thread_t *const th, const rb_iseq_t *iseq, int argc, VALUE *argv, const rb_block_t *blockptr, int lambda)
static VALUE | vm_invoke_block (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_num_t num, rb_num_t flag)
static NODE * | lfp_svar_place (rb_thread_t *th, VALUE *lfp)
static VALUE | lfp_svar_get (rb_thread_t *th, VALUE *lfp, VALUE key)
static void | lfp_svar_set (rb_thread_t *th, VALUE *lfp, VALUE key, VALUE val)
static VALUE | vm_getspecial (rb_thread_t *th, VALUE *lfp, VALUE key, rb_num_t type)
static NODE * | vm_get_cref0 (const rb_iseq_t *iseq, const VALUE *lfp, const VALUE *dfp)
static NODE * | vm_get_cref (const rb_iseq_t *iseq, const VALUE *lfp, const VALUE *dfp)
static NODE * | vm_cref_push (rb_thread_t *th, VALUE klass, int noex, rb_block_t *blockptr)
static VALUE | vm_get_cbase (const rb_iseq_t *iseq, const VALUE *lfp, const VALUE *dfp)
static VALUE | vm_get_const_base (const rb_iseq_t *iseq, const VALUE *lfp, const VALUE *dfp)
static void | vm_check_if_namespace (VALUE klass)
static VALUE | vm_get_ev_const (rb_thread_t *th, const rb_iseq_t *iseq, VALUE orig_klass, ID id, int is_defined)
static VALUE | vm_get_cvar_base (NODE *cref)
static VALUE | vm_search_const_defined_class (const VALUE cbase, ID id)
static VALUE | vm_getivar (VALUE obj, ID id, IC ic)
static void | vm_setivar (VALUE obj, ID id, VALUE val, IC ic)
static const rb_method_entry_t * | vm_method_search (VALUE id, VALUE klass, IC ic)
static VALUE | vm_search_normal_superclass (VALUE klass, VALUE recv)
static void | vm_search_superclass (rb_control_frame_t *reg_cfp, rb_iseq_t *iseq, VALUE recv, VALUE sigval, ID *idp, VALUE *klassp)
static VALUE | vm_throw (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_num_t throw_state, VALUE throwobj)
static void | vm_expandarray (rb_control_frame_t *cfp, VALUE ary, rb_num_t num, int flag)
static int | check_cfunc (const rb_method_entry_t *me, VALUE(*func)())
static VALUE | opt_eq_func (VALUE recv, VALUE obj, IC ic)

## Macro Definition Documentation

#define COLLECT_PROFILE 0

#define INLINE inline

Definition at line 20 of file vm_insnhelper.c.

#define USE_IC_FOR_IVAR 1

Definition at line 1275 of file vm_insnhelper.c.

#define VM_CALLEE_SETUP_ARG | ( |  | ret,
|  |  | th,
|  |  | iseq,
|  |  | orig_argc,
|  |  | orig_argv,
|  |  | block
| ) |  |

Value:
if (LIKELY((iseq)->arg_simple & 0x01)) { \
/* simple check */ \
if ((orig_argc) != (iseq)->argc) { \
argument_error((iseq), (orig_argc), (iseq)->argc); \
} \
(ret) = 0; \
} \
else { \
(ret) = vm_callee_setup_arg_complex((th), (iseq), (orig_argc), (orig_argv), (block)); \
}

Definition at line 135 of file vm_insnhelper.c.

Referenced by vm_setup_method(), and vm_yield_setup_args().

## Function Documentation

static void argument_error | ( | const rb_iseq_t * | iseq,
|  | int | miss_argc,
|  | int | correct_argc
| ) |  |

static

Definition at line 111 of file vm_insnhelper.c.

References rb_iseq_struct::filename, rb_iseq_struct::insn_info_size, rb_iseq_struct::insn_info_table, iseq_insn_info_entry::line_no, rb_iseq_struct::name, rb_eArgError, rb_exc_new3(), rb_exc_raise(), rb_funcall(), rb_intern, rb_make_backtrace(), rb_sprintf(), and RSTRING_PTR.

Referenced by vm_callee_setup_arg_complex().

static int block_proc_is_lambda | ( | const VALUE | procval | ) |

inline static

Definition at line 688 of file vm_insnhelper.c.

References GetProcPtr, and rb_proc_t::is_lambda.

Referenced by invoke_block_from_c(), vm_invoke_block(), and vm_yield_with_cfunc().

static VALUE call_cfunc | ( | VALUE(*)() | func,
|  | VALUE | recv,
|  | int | len,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |

inline static

Definition at line 302 of file vm_insnhelper.c.

References argc, argv, func, Qundef, rb_ary_new4(), rb_eArgError, and rb_raise().

Referenced by vm_call0(), and vm_call_cfunc().

static int caller_setup_args | ( | const rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | VALUE | flag,
|  | int | argc,
|  | rb_iseq_t * | blockiseq,
|  | rb_block_t ** | block
| ) |  |

inline static

Definition at line 238 of file vm_insnhelper.c.

References argc, rb_proc_t::block, CHECK_STACK_OVERFLOW, GetProcPtr, i, rb_block_struct::iseq, len, NIL_P, rb_block_struct::proc, Qnil, RARRAY_LEN, RARRAY_PTR, rb_check_convert_type(), rb_eTypeError, rb_obj_classname(), rb_obj_is_proc(), rb_raise(), RUBY_VM_GET_BLOCK_PTR_IN_CFP, rb_control_frame_t::sp, T_ARRAY, T_DATA, VM_CALL_ARGS_BLOCKARG_BIT, and VM_CALL_ARGS_SPLAT_BIT.

Referenced by vm_invoke_block().

static int check_cfunc | ( | const rb_method_entry_t * | me,
|  | VALUE(*)() | func
| ) |  |

inline static

Definition at line 1698 of file vm_insnhelper.c.

References rb_method_definition_struct::body, rb_method_definition_struct::cfunc, rb_method_entry_struct::def, rb_method_cfunc_struct::func, func, rb_method_definition_struct::type, and VM_METHOD_TYPE_CFUNC.

Referenced by opt_eq_func().

static VALUE lfp_svar_get | ( | rb_thread_t * | th,
|  | VALUE * | lfp,
|  | VALUE | key
| ) |  |

static

Definition at line 984 of file vm_insnhelper.c.

References hash(), lfp_svar_place(), Qnil, rb_hash_lookup, RNode::u1, RNode::u2, RNode::u3, and RNode::value.

Referenced by vm_cfp_svar_get(), and vm_getspecial().

static NODE* lfp_svar_place | ( | rb_thread_t * | th,
|  | VALUE * | lfp
| ) |  |

inline static

Definition at line 967 of file vm_insnhelper.c.

References rb_thread_struct::local_lfp, rb_thread_struct::local_svar, NEW_IF, NIL_P, and Qnil.

Referenced by lfp_svar_get(), and lfp_svar_set().

static void lfp_svar_set | ( | rb_thread_t * | th,
|  | VALUE * | lfp,
|  | VALUE | key,
|  | VALUE | val
| ) |  |

static

Definition at line 1007 of file vm_insnhelper.c.

References hash(), lfp_svar_place(), Qnil, rb_hash_aset(), rb_hash_new(), RNode::u1, RNode::u2, RNode::u3, and RNode::value.

Referenced by vm_cfp_svar_set().

NORETURN | ( | static void | argument_errorconst rb_iseq_t *iseq, int miss_argc, int correct_argc | ) |

static VALUE opt_eq_func | ( | VALUE | recv,
|  | VALUE | obj,
|  | IC | ic
| ) |  |

inline static

Definition at line 1714 of file vm_insnhelper.c.

References BASIC_OP_UNREDEFINED_P, BOP_EQ, check_cfunc(), CLASS_OF, FIXNUM_2_P, HEAP_CLASS_OF, idEq, isnan, Qfalse, Qtrue, Qundef, rb_cFloat, rb_cString, rb_obj_equal(), rb_str_equal(), RFLOAT_VALUE, SPECIAL_CONST_P, and vm_method_search().

static VALUE vm_call_bmethod | ( | rb_thread_t * | th,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv,
|  | const rb_block_t * | blockptr,
|  | const rb_method_entry_t * | me
| ) |  |

inline static

Definition at line 422 of file vm_insnhelper.c.

References rb_method_definition_struct::body, rb_method_entry_struct::called_id, rb_method_entry_struct::def, EXEC_EVENT_HOOK, GetProcPtr, rb_method_entry_struct::klass, rb_thread_struct::passed_me, rb_method_definition_struct::proc, rb_vm_invoke_proc(), RUBY_EVENT_CALL, and RUBY_EVENT_RETURN.

Referenced by vm_call0(), and vm_call_method().

static VALUE vm_call_cfunc | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | int | num,
|  | volatile VALUE | recv,
|  | const rb_block_t * | blockptr,
|  | const rb_method_entry_t * | me
| ) |  |

inline static

Definition at line 389 of file vm_insnhelper.c.

References rb_method_cfunc_struct::argc, rb_method_definition_struct::body, call_cfunc(), rb_method_entry_struct::called_id, rb_thread_struct::cfp, rb_method_definition_struct::cfunc, rb_method_entry_struct::def, EXEC_EVENT_HOOK, rb_method_cfunc_struct::func, rb_method_entry_struct::klass, rb_control_frame_t::me, rb_bug(), RUBY_EVENT_C_CALL, RUBY_EVENT_C_RETURN, rb_control_frame_t::sp, VM_FRAME_MAGIC_CFUNC, vm_pop_frame(), and vm_push_frame().

Referenced by vm_call_method().

static VALUE vm_call_method | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | int | num,
|  | const rb_block_t * | blockptr,
|  | VALUE | flag,
|  | ID | id,
|  | const rb_method_entry_t * | me,
|  | VALUE | recv
| ) |  |

inline static

Definition at line 516 of file vm_insnhelper.c.

References ALLOCA_N, argc, argv, rb_method_definition_struct::attr, rb_proc_t::block, rb_method_definition_struct::body, CLASS_OF, DEC_SP, rb_method_entry_struct::def, rb_method_entry_struct::flag, GetProcPtr, i, rb_method_attr_struct::id, ID2SYM, rb_method_entry_struct::klass, MEMCPY, MEMMOVE, NOEX_MASK, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_SAFE, NOEX_SUPER, NOEX_VCALL, rb_method_definition_struct::optimize_type, rb_method_definition_struct::original_id, rb_thread_struct::passed_block, Qundef, rb_attr_get(), rb_bug(), rb_eArgError, rb_eSecurityError, rb_funcall2(), rb_id2name(), rb_intern, rb_ivar_set(), rb_method_entry(), rb_obj_is_kind_of(), rb_raise(), rb_raise_method_missing(), rb_to_id(), RB_TYPE_P, rb_vm_invoke_proc(), RBASIC, RCLASS_SUPER, RUBY_VM_CHECK_INTS, rb_thread_struct::safe_level, rb_control_frame_t::self, rb_block_struct::self, rb_control_frame_t::sp, stat, sym, SYM2ID, SYMBOL_P, T_ICLASS, TOPN, rb_method_definition_struct::type, vm_call_bmethod(), vm_call_cfunc(), VM_CALL_FCALL_BIT, VM_CALL_OPT_SEND_BIT, VM_CALL_SUPER_BIT, VM_CALL_VCALL_BIT, vm_method_missing(), vm_method_missing_args(), VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_CFUNC, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_IVAR, VM_METHOD_TYPE_MISSING, VM_METHOD_TYPE_NOTIMPLEMENTED, VM_METHOD_TYPE_OPTIMIZED, VM_METHOD_TYPE_ZSUPER, and vm_setup_method().

static int vm_callee_setup_arg_complex | ( | rb_thread_t * | th,
|  | const rb_iseq_t * | iseq,
|  | int | orig_argc,
|  | VALUE * | orig_argv,
|  | const rb_block_t ** | block
| ) |  |

inline static

Definition at line 148 of file vm_insnhelper.c.

References ALLOCA_N, rb_iseq_struct::arg_block, rb_iseq_struct::arg_opt_table, rb_iseq_struct::arg_opts, rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_post_start, rb_iseq_struct::arg_rest, rb_iseq_struct::arg_size, argc, rb_iseq_struct::argc, argument_error(), argv, rb_proc_t::block, GetProcPtr, i, rb_thread_struct::mark_stack_len, MEMCPY, rb_block_struct::proc, Qnil, rb_ary_new4(), rb_cProc, and rb_vm_make_proc().

static void vm_check_if_namespace | ( | VALUE | klass | ) |

inline static

Definition at line 1146 of file vm_insnhelper.c.

References rb_eTypeError, rb_inspect(), rb_raise(), StringValuePtr, T_CLASS, T_MODULE, and TYPE.

Referenced by vm_get_ev_const().

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

static

Definition at line 1096 of file vm_insnhelper.c.

References rb_thread_struct::cfp, rb_control_frame_t::dfp, rb_block_struct::dfp, rb_control_frame_t::iseq, rb_block_struct::iseq, rb_control_frame_t::lfp, rb_block_struct::lfp, NEW_BLOCK, vm_get_cref0(), and vm_get_ruby_level_caller_cfp().

static void vm_expandarray | ( | rb_control_frame_t * | cfp,
|  | VALUE | ary,
|  | rb_num_t | num,
|  | int | flag
| ) |  |

inline static

Definition at line 1637 of file vm_insnhelper.c.

References i, len, Qnil, RARRAY_LEN, RARRAY_PTR, rb_ary_new(), rb_ary_new4(), rb_ary_to_ary(), rb_control_frame_t::sp, T_ARRAY, TYPE, and v.

static VALUE vm_get_cbase | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | lfp,
|  | const VALUE * | dfp
| ) |  |

inline static

Definition at line 1113 of file vm_insnhelper.c.

References Qundef, and vm_get_cref().

Referenced by rb_vm_cbase().

static VALUE vm_get_const_base | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | lfp,
|  | const VALUE * | dfp
| ) |  |

inline static

Definition at line 1129 of file vm_insnhelper.c.

References RNode::flags, NODE_FL_CREF_PUSHED_BY_EVAL, Qundef, and vm_get_cref().

static NODE* vm_get_cref | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | lfp,
|  | const VALUE * | dfp
| ) |  |

static

Definition at line 1085 of file vm_insnhelper.c.

References rb_bug(), and vm_get_cref0().

Referenced by rb_vm_cref(), vm_get_cbase(), vm_get_const_base(), and vm_get_ev_const().

static NODE* vm_get_cref0 | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | lfp,
|  | const VALUE * | dfp
| ) |  |

static

Definition at line 1070 of file vm_insnhelper.c.

References rb_iseq_struct::cref_stack, GET_PREV_DFP, NULL, Qnil, and RUBY_VM_NORMAL_ISEQ_P.

Referenced by vm_cref_push(), and vm_get_cref().

static VALUE vm_get_cvar_base | ( | NODE * | cref | ) |

inline static

Definition at line 1238 of file vm_insnhelper.c.

References FL_SINGLETON, FL_TEST, RNode::flags, NIL_P, NODE_FL_CREF_PUSHED_BY_EVAL, rb_eTypeError, rb_raise(), and rb_warn().

static VALUE vm_get_ev_const | ( | rb_thread_t * | th,
|  | const rb_iseq_t * | iseq,
|  | VALUE | orig_klass,
|  | ID | id,
|  | int | is_defined
| ) |  |

inline static

Definition at line 1161 of file vm_insnhelper.c.

References rb_thread_struct::cfp, CLASS_OF, rb_control_frame_t::dfp, RNode::flags, rb_control_frame_t::lfp, NIL_P, NODE_FL_CREF_PUSHED_BY_EVAL, Qnil, Qundef, rb_autoload_load(), rb_const_defined(), rb_const_get(), rb_public_const_defined_from(), rb_public_const_get_from(), RCLASS_CONST_TBL, rb_control_frame_t::self, st_lookup, RNode::value, vm_check_if_namespace(), and vm_get_cref().

static rb_control_frame_t* vm_get_ruby_level_caller_cfp | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp
| ) |  |

static

Referenced by vm_cref_push().

static VALUE vm_getivar | ( | VALUE | obj,
|  | ID | id,
|  | IC | ic
| ) |  |

static

Definition at line 1279 of file vm_insnhelper.c.

References GET_VM_STATE_VERSION, iseq_inline_cache_entry::ic_class, iseq_inline_cache_entry::ic_value, iseq_inline_cache_entry::ic_vmstat, iseq_inline_cache_entry::index, len, LIKELY, Qnil, Qundef, rb_id2name(), rb_ivar_get(), rb_warning(), RBASIC, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_lookup, T_OBJECT, TYPE, and UNLIKELY.

static VALUE vm_getspecial | ( | rb_thread_t * | th,
|  | VALUE * | lfp,
|  | VALUE | key,
|  | rb_num_t | type
| ) |  |

inline static

Definition at line 1030 of file vm_insnhelper.c.

References FIX2INT, FIXNUM_P, lfp_svar_get(), rb_bug(), rb_reg_last_match(), rb_reg_match_last(), rb_reg_match_post(), rb_reg_match_pre(), and rb_reg_nth_match().

static VALUE vm_invoke_block | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_num_t | num,
|  | rb_num_t | flag
| ) |  |

static

Definition at line 926 of file vm_insnhelper.c.

References rb_iseq_struct::arg_size, argc, block_proc_is_lambda(), BUILTIN_TYPE, caller_setup_args(), CHECK_STACK_OVERFLOW, rb_block_struct::dfp, GET_BLOCK_PTR, GET_CFP, GET_ISEQ, GET_SP, rb_block_struct::iseq, rb_iseq_struct::iseq_encoded, rb_block_struct::lfp, rb_iseq_struct::local_size, POPN, rb_block_struct::proc, Qnil, Qundef, rb_vm_localjump_error(), rb_block_struct::self, SET_SP, STACK_ADDR_FROM_TOP, rb_iseq_struct::stack_max, T_NODE, type, VM_FRAME_MAGIC_BLOCK, vm_push_frame(), vm_yield_setup_args(), and vm_yield_with_cfunc().

static VALUE vm_method_missing | ( | rb_thread_t * | th,
|  | ID | id,
|  | VALUE | recv,
|  | int | num,
|  | const rb_block_t * | blockptr,
|  | int | opt
| ) |  |

inline static

Definition at line 452 of file vm_insnhelper.c.

References ALLOCA_N, argv, ID2SYM, rb_funcall2(), and vm_method_missing_args().

Referenced by vm_call_method().

static void vm_method_missing_args | ( | rb_thread_t * | th,
|  | VALUE * | argv,
|  | int | num,
|  | const rb_block_t * | blockptr,
|  | int | opt
| ) |  |

inline static

Definition at line 441 of file vm_insnhelper.c.

References rb_thread_struct::cfp, MEMCPY, rb_thread_struct::method_missing_reason, rb_thread_struct::passed_block, POPN, and STACK_ADDR_FROM_TOP.

Referenced by vm_call_method(), and vm_method_missing().

static const rb_method_entry_t* vm_method_search | ( | VALUE | id,
|  | VALUE | klass,
|  | IC | ic
| ) |  |

inline static

Definition at line 1370 of file vm_insnhelper.c.

References GET_VM_STATE_VERSION, iseq_inline_cache_entry::ic_class, iseq_inline_cache_entry::ic_value, iseq_inline_cache_entry::ic_vmstat, LIKELY, iseq_inline_cache_entry::method, and rb_method_entry().

Referenced by opt_eq_func().

static void vm_pop_frame | ( | rb_thread_t * | th | ) |

inline static

Definition at line 81 of file vm_insnhelper.c.

References rb_thread_struct::cfp, rb_control_frame_t::iseq, RUBY_VM_NORMAL_ISEQ_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, SDR, and VMDEBUG.

Referenced by rb_vm_call_cfunc(), vm_call0(), vm_call_cfunc(), and vm_exec().

static rb_control_frame_t* vm_push_frame | ( | rb_thread_t * | th,
|  | const rb_iseq_t * | iseq,
|  | VALUE | type,
|  | VALUE | self,
|  | VALUE | specval,
|  | const VALUE * | pc,
|  | VALUE * | sp,
|  | VALUE * | lfp,
|  | int | local_size
| ) |  |

inline static

Definition at line 26 of file vm_insnhelper.c.

References rb_control_frame_t::block_iseq, rb_control_frame_t::bp, rb_thread_struct::cfp, rb_control_frame_t::dfp, rb_control_frame_t::flag, GC_GUARDED_PTR, i, rb_control_frame_t::iseq, rb_control_frame_t::lfp, rb_control_frame_t::me, rb_control_frame_t::pc, rb_control_frame_t::proc, Qnil, rb_exc_raise(), SDR, rb_control_frame_t::self, rb_control_frame_t::sp, sysstack_error, type, and VMDEBUG.

Referenced by invoke_block_from_c(), rb_vm_call_cfunc(), rb_vm_set_finish_env(), th_init(), vm_call0(), vm_call_cfunc(), vm_exec(), vm_invoke_block(), vm_set_eval_stack(), vm_set_top_stack(), vm_setup_method(), and vm_yield_with_cfunc().

static VALUE vm_search_const_defined_class | ( | const VALUE | cbase,
|  | ID | id
| ) |  |

static

Definition at line 1261 of file vm_insnhelper.c.

References rb_cObject, rb_const_defined_at(), and RCLASS_SUPER.

static VALUE vm_search_normal_superclass | ( | VALUE | klass,
|  | VALUE | recv
| ) |  |

inline static

Definition at line 1391 of file vm_insnhelper.c.

References BUILTIN_TYPE, CLASS_OF, rb_bug(), rb_cObject, RBASIC, RCLASS_SUPER, T_CLASS, T_ICLASS, and T_MODULE.

Referenced by vm_call_super(), and vm_search_superclass().

static void vm_search_superclass | ( | rb_control_frame_t * | reg_cfp,
|  | rb_iseq_t * | iseq,
|  | VALUE | recv,
|  | VALUE | sigval,
|  | ID * | idp,
|  | VALUE * | klassp
| ) |  |

static

Definition at line 1412 of file vm_insnhelper.c.

References rb_method_entry_struct::def, rb_iseq_struct::defined_method_id, rb_control_frame_t::dfp, GET_CFP, GET_PREV_DFP, GET_THREAD, id, rb_control_frame_t::iseq, rb_method_entry_struct::klass, rb_iseq_struct::klass, rb_iseq_struct::local_iseq, rb_control_frame_t::me, rb_method_definition_struct::original_id, rb_iseq_struct::parent_iseq, rb_eNoMethodError, rb_eRuntimeError, rb_raise(), RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, and vm_search_normal_superclass().

static void vm_setivar | ( | VALUE | obj,
|  | ID | id,
|  | VALUE | val,
|  | IC | ic
| ) |  |

static

Definition at line 1328 of file vm_insnhelper.c.

References GET_VM_STATE_VERSION, iseq_inline_cache_entry::ic_class, iseq_inline_cache_entry::ic_value, iseq_inline_cache_entry::ic_vmstat, iseq_inline_cache_entry::index, len, LIKELY, OBJ_UNTRUSTED, rb_check_frozen, rb_eSecurityError, rb_ivar_set(), rb_raise(), rb_safe_level, RBASIC, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_lookup, T_OBJECT, and TYPE.

static void vm_setup_method | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | VALUE | recv,
|  | int | argc,
|  | const rb_block_t * | blockptr,
|  | VALUE | flag,
|  | const rb_method_entry_t * | me
| ) |  |

inline static

Definition at line 462 of file vm_insnhelper.c.

References rb_iseq_struct::arg_size, argc, rb_method_definition_struct::body, rb_thread_struct::cfp, CHECK_STACK_OVERFLOW, rb_method_entry_struct::def, i, rb_method_definition_struct::iseq, rb_iseq_struct::iseq_encoded, LIKELY, rb_iseq_struct::local_size, Qnil, rb_control_frame_t::sp, rb_iseq_struct::stack_max, VM_CALL_TAILCALL_BIT, VM_CALLEE_SETUP_ARG, VM_FRAME_MAGIC_METHOD, and vm_push_frame().

Referenced by vm_call0(), and vm_call_method().

static VALUE vm_throw | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_num_t | throw_state,
|  | VALUE | throwobj
| ) |  |

static

Definition at line 1470 of file vm_insnhelper.c.

References BUILTIN_TYPE, rb_iseq_struct::catch_table, rb_iseq_struct::catch_table_size, iseq_catch_table_entry::CATCH_TYPE_BREAK, iseq_catch_table_entry::cont, rb_control_frame_t::dfp, iseq_catch_table_entry::end, err, FIX2INT, FIXNUM_P, GC_GUARDED_PTR_REF, GET_CFP, GET_DFP, GET_ISEQ, GET_LFP, GET_THROWOBJ_STATE, i, rb_control_frame_t::iseq, rb_iseq_struct::iseq_encoded, rb_control_frame_t::lfp, NEW_THROW_OBJECT, rb_iseq_struct::parent_iseq, rb_control_frame_t::pc, rb_bug(), rb_vm_localjump_error(), RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_thread_struct::stack_size, iseq_catch_table_entry::start, rb_thread_struct::state, SYMBOL_P, T_NODE, TAG_BREAK, TAG_RAISE, TAG_RETRY, TAG_RETURN, TAG_THROW, iseq_catch_table_entry::type, rb_iseq_struct::type, VM_FRAME_MAGIC_LAMBDA, and VM_FRAME_TYPE.

static int vm_yield_setup_args | ( | rb_thread_t *const | th,
|  | const rb_iseq_t * | iseq,
|  | int | argc,
|  | VALUE * | argv,
|  | const rb_block_t * | blockptr,
|  | int | lambda
| ) |  |

inline static

Definition at line 899 of file vm_insnhelper.c.

References rb_iseq_struct::arg_block, rb_iseq_struct::arg_opts, rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_rest, rb_iseq_struct::arg_simple, rb_iseq_struct::argc, VM_CALLEE_SETUP_ARG, and vm_yield_setup_block_args().

Referenced by invoke_block_from_c(), and vm_invoke_block().

static int vm_yield_setup_block_args | ( | rb_thread_t * | th,
|  | const rb_iseq_t * | iseq,
|  | int | orig_argc,
|  | VALUE * | argv,
|  | const rb_block_t * | blockptr
| ) |  |

inline static

Definition at line 808 of file vm_insnhelper.c.

References rb_iseq_struct::arg_block, rb_iseq_struct::arg_opts, rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_rest, rb_iseq_struct::arg_simple, rb_iseq_struct::arg_size, argc, rb_iseq_struct::argc, rb_thread_struct::cfp, CHECK_STACK_OVERFLOW, i, rb_thread_struct::mark_stack_len, MEMCPY, NIL_P, rb_block_struct::proc, Qnil, RARRAY_LENINT, RARRAY_PTR, rb_ary_new(), rb_ary_new4(), rb_check_array_type(), rb_cProc, rb_vm_make_proc(), and vm_yield_setup_block_args_complex().

Referenced by vm_yield_setup_args().

static int vm_yield_setup_block_args_complex | ( | rb_thread_t * | th,
|  | const rb_iseq_t * | iseq,
|  | int | argc,
|  | VALUE * | argv
| ) |  |

inline static

Definition at line 751 of file vm_insnhelper.c.

References rb_iseq_struct::arg_opt_table, rb_iseq_struct::arg_opts, rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_post_start, rb_iseq_struct::arg_rest, rb_iseq_struct::argc, i, len, MEMMOVE, Qnil, and rb_ary_new4().

Referenced by vm_yield_setup_block_args().

static VALUE vm_yield_with_cfunc | ( | rb_thread_t * | th,
|  | const rb_block_t * | block,
|  | VALUE | self,
|  | int | argc,
|  | const VALUE * | argv,
|  | const rb_block_t * | blockargptr
| ) |  |

inline static

Definition at line 702 of file vm_insnhelper.c.

References arg, block_proc_is_lambda(), rb_thread_struct::cfp, rb_block_struct::dfp, GC_GUARDED_PTR, rb_block_struct::iseq, rb_control_frame_t::lfp, rb_block_struct::lfp, rb_block_struct::proc, Qnil, rb_ary_new4(), rb_cProc, rb_vm_make_proc(), rb_control_frame_t::sp, VM_FRAME_MAGIC_IFUNC, and vm_push_frame().

Referenced by invoke_block_from_c(), and vm_invoke_block().