Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Defines | Functions

# vm_insnhelper.c File Reference

`#include "insns.inc"`
`#include <math.h>`
Include dependency graph for vm_insnhelper.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | opt_case_dispatch_i_arg
## Defines
#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, 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_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 *ip, 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)
static int | opt_case_dispatch_i (st_data_t key, st_data_t data, st_data_t p)

## Define Documentation

#define COLLECT_PROFILE 0

#define INLINE inline

Definition at line 18 of file vm_insnhelper.c.

#define USE_IC_FOR_IVAR 1

Definition at line 1241 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 133 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 109 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 677 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 300 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 236 of file vm_insnhelper.c.

References argc, rb_proc_t::block, CHECK_STACK_OVERFLOW, GetProcPtr, 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 1648 of file vm_insnhelper.c.

References rb_method_definition_struct::body, rb_method_definition_struct::cfunc, rb_method_entry_struct::def, func, rb_method_cfunc_struct::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 973 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 956 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 996 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 int opt_case_dispatch_i | ( | st_data_t | key,
|  | st_data_t | data,
|  | st_data_t | p
| ) |  | `[static]`

Definition at line 1707 of file vm_insnhelper.c.

References FIX2INT, idEqq, opt_case_dispatch_i_arg::label, opt_case_dispatch_i_arg::obj, rb_funcall(), RTEST, ST_CONTINUE, and ST_STOP.

static VALUE opt_eq_func | ( | VALUE | recv,
|  | VALUE | obj,
|  | IC | ic
| ) |  | `[inline, static]`

Definition at line 1664 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 416 of file vm_insnhelper.c.

References rb_method_definition_struct::body, rb_method_entry_struct::def, GetProcPtr, rb_thread_struct::passed_me, rb_method_definition_struct::proc, and rb_vm_invoke_proc().

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,
|  | VALUE | recv,
|  | const rb_block_t * | blockptr,
|  | const rb_method_entry_t * | me
| ) |  | `[inline, static]`

Definition at line 387 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 506 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, 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, 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_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, SYM2ID, SYMBOL_P, T_ICLASS, TOPN, TYPE, 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 146 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, 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 1135 of file vm_insnhelper.c.

References rb_eTypeError, rb_inspect(), rb_raise(), RSTRING_PTR, 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 1084 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, RNode::nd_file, 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 1587 of file vm_insnhelper.c.

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

static VALUE vm_get_cbase | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | lfp,
|  | const VALUE * | dfp
| ) |  | `[inline, static]`

Definition at line 1102 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 1118 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 1073 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 1059 of file vm_insnhelper.c.

References rb_iseq_struct::cref_stack, GET_PREV_DFP, and Qnil.

Referenced by vm_cref_push(), and vm_get_cref().

static VALUE vm_get_cvar_base | ( | NODE * | cref | ) | `[inline, static]`

Definition at line 1217 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 1148 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, NULL, Qnil, Qundef, rb_autoload_load(), rb_const_defined(), rb_const_defined_from(), rb_const_get(), rb_const_get_from(), RCLASS_IV_TBL, rb_control_frame_t::self, st_lookup, 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 1245 of file vm_insnhelper.c.

References iseq_inline_cache_entry::ic_class, iseq_inline_cache_entry::ic_value, iseq_inline_cache_entry::index, len, 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 1019 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 915 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, ISEQ_TYPE_CLASS, ISEQ_TYPE_METHOD, 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 442 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 431 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 1333 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 79 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 24 of file vm_insnhelper.c.

References rb_thread_struct::cfp, GC_GUARDED_PTR, Qnil, rb_exc_raise(), SDR, sysstack_error, type, and VMDEBUG.

Referenced by invoke_block_from_c(), rb_vm_call_cfunc(), rb_vm_set_finish_env(), th_init2(), 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_normal_superclass | ( | VALUE | klass,
|  | VALUE | recv
| ) |  | `[inline, static]`

Definition at line 1354 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 * | ip,
|  | VALUE | recv,
|  | VALUE | sigval,
|  | ID * | idp,
|  | VALUE * | klassp
| ) |  | `[static]`

Definition at line 1375 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, 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_PREVIOUS_CONTROL_FRAME, and vm_search_normal_superclass().

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

Definition at line 1292 of file vm_insnhelper.c.

References iseq_inline_cache_entry::ic_class, iseq_inline_cache_entry::ic_value, iseq_inline_cache_entry::index, len, OBJ_FROZEN, OBJ_UNTRUSTED, rb_error_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 452 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, 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 1428 of file vm_insnhelper.c.

References BUILTIN_TYPE, rb_iseq_struct::catch_table, rb_iseq_struct::catch_table_size, 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, rb_control_frame_t::iseq, rb_iseq_struct::iseq_encoded, ISEQ_TYPE_BLOCK, ISEQ_TYPE_CLASS, ISEQ_TYPE_METHOD, 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 888 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 797 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, rb_iseq_struct::argc, argc, rb_thread_struct::cfp, CHECK_STACK_OVERFLOW, 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 740 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, 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 691 of file vm_insnhelper.c.

References 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().