Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
vm_insnhelper.c File Reference
`#include "insns.inc"`
`#include <math.h>`
`#include "constant.h"`
`#include "internal.h"`
`#include "probes.h"`
`#include "probes_helper.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.

## Macros
#define | INLINE inline
#define | USE_IC_FOR_IVAR 1
#define | CHECK_CMP_NAN(a, b) /* do nothing */
#define | SAVE_RESTORE_CI(expr, ci)
#define | VM_CALLEE_SETUP_ARG(th, ci, iseq, argv, is_lambda)
#define | VM_PROFILE 0
#define | VM_PROFILE_UP(x)
#define | VM_PROFILE_ATEXIT()

## Functions
static rb_control_frame_t * | vm_get_ruby_level_caller_cfp (rb_thread_t *th, rb_control_frame_t *cfp)
static void | vm_stackoverflow (void)
static rb_control_frame_t * | vm_push_frame (rb_thread_t *th, const rb_iseq_t *iseq, VALUE type, VALUE self, VALUE klass, VALUE specval, const VALUE *pc, VALUE *sp, int local_size, const rb_method_entry_t *me)
static void | vm_pop_frame (rb_thread_t *th)
static VALUE | rb_arg_error_new (int argc, int min, int max)
| NORETURN (static void argument_error(const rb_iseq_t *iseq, int miss_argc, int min_argc, int max_argc))
static void | argument_error (const rb_iseq_t *iseq, int miss_argc, int min_argc, int max_argc)
| NORETURN (static void unknown_keyword_error(const rb_iseq_t *iseq, VALUE hash))
static void | unknown_keyword_error (const rb_iseq_t *iseq, VALUE hash)
void | rb_error_arity (int argc, int min, int max)
static NODE * | lep_svar_place (rb_thread_t *th, VALUE *lep)
static VALUE | lep_svar_get (rb_thread_t *th, VALUE *lep, rb_num_t key)
static void | lep_svar_set (rb_thread_t *th, VALUE *lep, rb_num_t key, VALUE val)
static VALUE | vm_getspecial (rb_thread_t *th, VALUE *lep, rb_num_t key, rb_num_t type)
static NODE * | vm_get_cref0 (const rb_iseq_t *iseq, const VALUE *ep)
NODE * | rb_vm_get_cref (const rb_iseq_t *iseq, const VALUE *ep)
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 *ep)
static VALUE | vm_get_const_base (const rb_iseq_t *iseq, const VALUE *ep)
static void | vm_check_if_namespace (VALUE klass)
static VALUE | vm_get_iclass (rb_control_frame_t *cfp, 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, rb_control_frame_t *cfp)
static VALUE | vm_search_const_defined_class (const VALUE cbase, ID id)
static VALUE | vm_getivar (VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr)
static VALUE | vm_setivar (VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr)
static VALUE | vm_getinstancevariable (VALUE obj, ID id, IC ic)
static void | vm_setinstancevariable (VALUE obj, ID id, VALUE val, IC ic)
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 VALUE | vm_call_general (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
static void | vm_search_method (rb_call_info_t *ci, VALUE recv)
static int | check_cfunc (const rb_method_entry_t *me, VALUE(*func)())
static VALUE | opt_eq_func (VALUE recv, VALUE obj, CALL_INFO ci)
static VALUE | vm_call0 (rb_thread_t *, VALUE, ID, int, const VALUE *, const rb_method_entry_t *, VALUE)
static VALUE | check_match (VALUE pattern, VALUE target, enum vm_check_match_type type)
static VALUE | double_cmp_lt (double a, double b)
static VALUE | double_cmp_le (double a, double b)
static VALUE | double_cmp_gt (double a, double b)
static VALUE | double_cmp_ge (double a, double b)
static VALUE * | vm_base_ptr (rb_control_frame_t *cfp)
static void | vm_caller_setup_args (const rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static int | separate_symbol (st_data_t key, st_data_t value, st_data_t arg)
static VALUE | extract_keywords (VALUE *orighash)
static int | vm_callee_setup_keyword_arg (const rb_iseq_t *iseq, int argc, int m, VALUE *orig_argv, VALUE *kwd)
static int | vm_callee_setup_arg_complex (rb_thread_t *th, rb_call_info_t *ci, const rb_iseq_t *iseq, VALUE *orig_argv)
static VALUE | vm_call_iseq_setup_2 (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_iseq_setup_normal (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_iseq_setup_tailcall (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_iseq_setup (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | call_cfunc_m2 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_m1 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_0 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_1 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_2 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_3 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_4 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_5 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_6 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_7 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_8 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_9 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_10 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_11 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_12 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_13 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_14 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | call_cfunc_15 (VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
static VALUE | vm_call_cfunc_with_frame (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
static VALUE | vm_call_cfunc (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
static VALUE | vm_call_ivar (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_attrset (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_bmethod_body (rb_thread_t *th, rb_call_info_t *ci, const VALUE *argv)
static VALUE | vm_call_bmethod (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_method (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_opt_send (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
static VALUE | vm_call_opt_call (rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
static VALUE | vm_call_method_missing (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
static VALUE | find_refinement (VALUE refinements, VALUE klass)
static int | rb_method_definition_eq (const rb_method_definition_t *d1, const rb_method_definition_t *d2)
static VALUE | vm_call_super_method (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
static rb_control_frame_t * | current_method_entry (rb_thread_t *th, rb_control_frame_t *cfp)
static VALUE | vm_search_normal_superclass (VALUE klass)
static void | vm_super_outside (void)
static int | vm_search_superclass (rb_control_frame_t *reg_cfp, rb_iseq_t *iseq, VALUE sigval, rb_call_info_t *ci)
static void | vm_search_super_method (rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci)
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_call_info_t *ci)

## Macro Definition Documentation

#define CHECK_CMP_NAN | ( |  | a,
|  |  | b
| ) |  | /* do nothing */

Definition at line 949 of file vm_insnhelper.c.

Referenced by double_cmp_ge(), double_cmp_gt(), double_cmp_le(), and double_cmp_lt().

#define INLINE inline

Definition at line 22 of file vm_insnhelper.c.

#define SAVE_RESTORE_CI | ( |  | expr,
|  |  | ci
| ) |  |

Value:
do { \
int saved_argc = (ci)->argc; rb_block_t *saved_blockptr = (ci)->blockptr; /* save */ \
expr; \
(ci)->argc = saved_argc; (ci)->blockptr = saved_blockptr; /* restore */ \
} while (0)
int
VP_EXPORT int
Definition: bigdecimal.c:5050
rb_block_struct
Definition: vm_core.h:442
argc
int argc
Definition: tcltklib.c:1970
expr
expr expr keyword_or expr
Definition: ripper.y:1291

Referenced by vm_caller_setup_args().

#define USE_IC_FOR_IVAR 1

Definition at line 496 of file vm_insnhelper.c.

#define VM_CALLEE_SETUP_ARG | ( |  | th,
|  |  | ci,
|  |  | iseq,
|  |  | argv,
|  |  | is_lambda
| ) |  |

Value:
if (LIKELY((iseq)->arg_simple & 0x01)) { \
/* simple check */ \
if ((ci)->argc != (iseq)->argc) { \
argument_error((iseq), ((ci)->argc), (iseq)->argc, (iseq)->argc); \
} \
(ci)->aux.opt_pc = 0; \
CI_SET_FASTPATH((ci), UNLIKELY((ci)->flag & VM_CALL_TAILCALL) ? vm_call_iseq_setup_tailcall : vm_call_iseq_setup_normal, !(is_lambda) && !((ci)->me->flag & NOEX_PROTECTED)); \
} \
else { \
(ci)->aux.opt_pc = vm_callee_setup_arg_complex((th), (ci), (iseq), (argv)); \
}
argument_error
static void argument_error(const rb_iseq_t *iseq, int miss_argc, int min_argc, int max_argc)
Definition: vm_insnhelper.c:127
th
static VALUE VALUE th
Definition: tcltklib.c:2948
vm_call_iseq_setup_tailcall
static VALUE vm_call_iseq_setup_tailcall(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
Definition: vm_insnhelper.c:1283
LIKELY
#define LIKELY(x)
Definition: vm_core.h:114
flag
flag
Definition: tcltklib.c:2048
vm_call_iseq_setup_normal
static VALUE vm_call_iseq_setup_normal(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
Definition: vm_insnhelper.c:1260
UNLIKELY
#define UNLIKELY(x)
Definition: vm_core.h:115
argv
VALUE * argv
Definition: tcltklib.c:1971
CI_SET_FASTPATH
#define CI_SET_FASTPATH(ci, func, enabled)
Definition: vm_insnhelper.h:213
argc
int argc
Definition: tcltklib.c:1970
NOEX_PROTECTED
Definition: method.h:26
else
else
Definition: bigdecimal.c:1192
if
if(RB_TYPE_P(r, T_FLOAT))
Definition: bigdecimal.c:1186
vm_callee_setup_arg_complex
static int vm_callee_setup_arg_complex(rb_thread_t *th, rb_call_info_t *ci, const rb_iseq_t *iseq, VALUE *orig_argv)
Definition: vm_insnhelper.c:1132
VM_CALL_TAILCALL
#define VM_CALL_TAILCALL
Definition: vm_core.h:713

Definition at line 1228 of file vm_insnhelper.c.

Referenced by vm_call_iseq_setup(), and vm_yield_setup_args().

#define VM_PROFILE 0

Definition at line 1430 of file vm_insnhelper.c.

#define VM_PROFILE_ATEXIT | ( |  | ) |

Definition at line 1447 of file vm_insnhelper.c.

Referenced by Init_VM().

#define VM_PROFILE_UP | ( |  | x | ) |

Definition at line 1446 of file vm_insnhelper.c.

Referenced by vm_call0_cfunc_with_frame(), and vm_call_cfunc_with_frame().

## Function Documentation

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

Definition at line 127 of file vm_insnhelper.c.

References exc, rb_iseq_location_struct::label, rb_iseq_struct::location, rb_iseq_location_struct::path, rb_arg_error_new(), rb_exc_raise(), rb_funcall(), rb_intern, rb_iseq_first_lineno(), 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 2049 of file vm_insnhelper.c.

References GetProcPtr, rb_proc_t::is_lambda, and proc.

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

static VALUE call_cfunc_0 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1334 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_1 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1340 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_10 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1394 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_11 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1400 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_12 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1406 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_13 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1412 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_14 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1418 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_15 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1424 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_2 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1346 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_3 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1352 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_4 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1358 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_5 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1364 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_6 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1370 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_7 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1376 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_8 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1382 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_9 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1388 of file vm_insnhelper.c.

References func.

static VALUE call_cfunc_m1 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1328 of file vm_insnhelper.c.

References argc, argv, and func.

static VALUE call_cfunc_m2 | ( | VALUE(*)(ANYARGS) | func,
|  | VALUE | recv,
|  | int | argc,
|  | const VALUE * | argv
| ) |  |
| static

Definition at line 1322 of file vm_insnhelper.c.

References func, and rb_ary_new4().

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

Definition at line 865 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 check_match | ( | VALUE | pattern,
|  | VALUE | target,
|  | enum vm_check_match_type | type
| ) |  |
| static

Definition at line 925 of file vm_insnhelper.c.

References CLASS_OF, GET_THREAD(), idEqq, rb_bug(), rb_cModule, rb_eTypeError, rb_method_entry_with_refinements(), rb_obj_is_kind_of(), rb_raise(), vm_call0(), VM_CHECKMATCH_TYPE_CASE, VM_CHECKMATCH_TYPE_RESCUE, and VM_CHECKMATCH_TYPE_WHEN.

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

Definition at line 1715 of file vm_insnhelper.c.

References rb_control_frame_struct::iseq, rb_iseq_struct::local_iseq, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, and rb_iseq_struct::type.

Referenced by vm_call_method().

static VALUE double_cmp_ge | ( | double | a,
|  | double | b
| ) |  |
| inline static

Definition at line 974 of file vm_insnhelper.c.

References CHECK_CMP_NAN, Qfalse, and Qtrue.

static VALUE double_cmp_gt | ( | double | a,
|  | double | b
| ) |  |
| inline static

Definition at line 967 of file vm_insnhelper.c.

References CHECK_CMP_NAN, Qfalse, and Qtrue.

static VALUE double_cmp_le | ( | double | a,
|  | double | b
| ) |  |
| inline static

Definition at line 960 of file vm_insnhelper.c.

References CHECK_CMP_NAN, Qfalse, and Qtrue.

static VALUE double_cmp_lt | ( | double | a,
|  | double | b
| ) |  |
| inline static

Definition at line 953 of file vm_insnhelper.c.

References CHECK_CMP_NAN, Qfalse, and Qtrue.

static VALUE extract_keywords | ( | VALUE * | orighash | ) |
| static

Definition at line 1084 of file vm_insnhelper.c.

References hash, RHASH_EMPTY_P, RHASH_TBL, separate_symbol(), and st_foreach().

Referenced by vm_callee_setup_keyword_arg().

static VALUE find_refinement | ( | VALUE | refinements,
|  | VALUE | klass
| ) |  |
| inline static

Definition at line 1703 of file vm_insnhelper.c.

References NIL_P(), Qnil, and rb_hash_lookup.

Referenced by rb_resolve_refined_method(), and vm_call_method().

static VALUE lep_svar_get | ( | rb_thread_t * | th,
|  | VALUE * | lep,
|  | rb_num_t | key
| ) |  |
| static

Definition at line 189 of file vm_insnhelper.c.

References ary, DEFAULT_SPECIAL_VAR_COUNT, lep_svar_place(), NIL_P(), Qnil, rb_ary_entry(), RNode::u1, RNode::u2, RNode::u3, and RNode::value.

Referenced by vm_cfp_svar_get(), and vm_getspecial().

static NODE* lep_svar_place | ( | rb_thread_t * | th,
|  | VALUE * | lep
| ) |  |
| inline static

Definition at line 172 of file vm_insnhelper.c.

References NEW_IF, NIL_P(), Qnil, rb_thread_struct::root_lep, and rb_thread_struct::root_svar.

Referenced by lep_svar_get(), and lep_svar_set().

static void lep_svar_set | ( | rb_thread_t * | th,
|  | VALUE * | lep,
|  | rb_num_t | key,
|  | VALUE | val
| ) |  |
| static

Definition at line 212 of file vm_insnhelper.c.

References ary, DEFAULT_SPECIAL_VAR_COUNT, lep_svar_place(), NIL_P(), rb_ary_new(), rb_ary_store(), RNode::u1, RNode::u2, RNode::u3, val, and RNode::value.

Referenced by vm_cfp_svar_set().

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

NORETURN | ( | static void | unknown_keyword_errorconst rb_iseq_t *iseq, VALUE hash | ) |

static VALUE opt_eq_func | ( | VALUE | recv,
|  | VALUE | obj,
|  | CALL_INFO | ci
| ) |  |
| inline static

Definition at line 881 of file vm_insnhelper.c.

References a, b, BASIC_OP_UNREDEFINED_P, BOP_EQ, check_cfunc(), FIXNUM_2_P, FIXNUM_REDEFINED_OP_FLAG, FLOAT_REDEFINED_OP_FLAG, FLONUM_2_P, HEAP_CLASS_OF, isnan, rb_call_info_struct::me, Qfalse, Qtrue, Qundef, rb_cFloat, rb_cString, rb_obj_equal(), rb_str_equal(), RFLOAT_VALUE, SPECIAL_CONST_P, STRING_REDEFINED_OP_FLAG, and vm_search_method().

static VALUE rb_arg_error_new | ( | int | argc,
|  | int | min,
|  | int | max
| ) |  |
| inline static

Definition at line 110 of file vm_insnhelper.c.

References rb_eArgError, rb_exc_new3(), rb_sprintf(), and UNLIMITED_ARGUMENTS.

Referenced by argument_error(), and rb_error_arity().

void rb_error_arity | ( | int | argc,
|  | int | min,
|  | int | max
| ) |  |

Definition at line 164 of file vm_insnhelper.c.

References rb_arg_error_new(), and rb_exc_raise().

Referenced by econv_args(), econv_primitive_convert(), rb_io_s_popen(), and rb_scan_args().

static int rb_method_definition_eq | ( | const rb_method_definition_t * | d1,
|  | const rb_method_definition_t * | d2
| ) |  |
| static

Referenced by vm_call_method().

NODE* rb_vm_get_cref | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | ep
| ) |  |

Definition at line 286 of file vm_insnhelper.c.

References rb_bug(), and vm_get_cref0().

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

static int separate_symbol | ( | st_data_t | key,
|  | st_data_t | value,
|  | st_data_t | arg
| ) |  |
| static

Definition at line 1073 of file vm_insnhelper.c.

References rb_hash_aset(), rb_hash_new(), ST_CONTINUE, and SYMBOL_P.

Referenced by extract_keywords().

static void unknown_keyword_error | ( | const rb_iseq_t * | iseq,
|  | VALUE | hash
| ) |  |
| static

Definition at line 148 of file vm_insnhelper.c.

References rb_iseq_struct::arg_keyword_table, rb_iseq_struct::arg_keywords, i, ID2SYM, keys, msg, PRIsVALUE, RARRAY_LEN, rb_eArgError, rb_funcall(), rb_hash_delete(), rb_intern, rb_raise(), RB_TYPE_P, rb_usascii_str_new2, and T_ARRAY.

Referenced by vm_callee_setup_keyword_arg().

static VALUE* vm_base_ptr | ( | rb_control_frame_t * | cfp | ) |
| static

Definition at line 981 of file vm_insnhelper.c.

References bp, GET_THREAD(), rb_control_frame_struct::iseq, rb_iseq_struct::local_size, rb_bug(), RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_control_frame_struct::sp, and rb_iseq_struct::type.

Referenced by vm_exec().

static VALUE vm_call0 | ( | rb_thread_t * | ,
|  | VALUE | ,
|  | ID | ,
|  | int | ,
|  | const VALUE * | ,
|  | const rb_method_entry_t * | ,
|  | VALUE |
| ) |  |
| static

Referenced by check_match().

static VALUE vm_call_attrset | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1577 of file vm_insnhelper.c.

References rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_method_entry_struct::def, rb_method_attr_struct::id, rb_call_info_struct::me, rb_call_info_struct::recv, rb_control_frame_struct::sp, val, and vm_setivar().

Referenced by vm_call_method().

static VALUE vm_call_bmethod | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1605 of file vm_insnhelper.c.

References ALLOCA_N, rb_call_info_struct::argc, MEMCPY, rb_control_frame_struct::sp, and vm_call_bmethod_body().

Referenced by vm_call_method().

static VALUE vm_call_bmethod_body | ( | rb_thread_t * | th,
|  | rb_call_info_t * | ci,
|  | const VALUE * | argv
| ) |  |
| inline static

Definition at line 1585 of file vm_insnhelper.c.

References rb_call_info_struct::argc, rb_call_info_struct::blockptr, rb_method_definition_struct::body, rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_call_info_struct::defined_class, EXEC_EVENT_HOOK, GetProcPtr, rb_method_entry_struct::klass, rb_call_info_struct::me, rb_thread_struct::passed_me, rb_method_definition_struct::proc, proc, Qnil, rb_call_info_struct::recv, RUBY_DTRACE_METHOD_ENTRY_HOOK, RUBY_DTRACE_METHOD_RETURN_HOOK, RUBY_EVENT_CALL, RUBY_EVENT_RETURN, val, and vm_invoke_proc().

Referenced by vm_call0_body(), and vm_call_bmethod().

static VALUE vm_call_cfunc | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1562 of file vm_insnhelper.c.

References vm_call_cfunc_with_frame().

Referenced by vm_call_method().

static VALUE vm_call_cfunc_with_frame | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1451 of file vm_insnhelper.c.

References rb_method_cfunc_struct::argc, rb_call_info_struct::argc, argc, rb_call_info_struct::blockptr, rb_method_definition_struct::body, rb_method_entry_struct::called_id, rb_thread_struct::cfp, rb_method_definition_struct::cfunc, rb_method_entry_struct::def, rb_call_info_struct::defined_class, EXEC_EVENT_HOOK, rb_method_cfunc_struct::func, rb_method_cfunc_struct::invoker, rb_method_entry_struct::klass, len, rb_call_info_struct::me, Qundef, rb_bug(), rb_check_arity, rb_call_info_struct::recv, RUBY_DTRACE_CMETHOD_ENTRY_HOOK, RUBY_DTRACE_CMETHOD_RETURN_HOOK, RUBY_EVENT_C_CALL, RUBY_EVENT_C_RETURN, rb_control_frame_struct::sp, val, VM_ENVVAL_BLOCK_PTR, VM_FRAME_MAGIC_CFUNC, vm_pop_frame(), VM_PROFILE_UP, and vm_push_frame().

Referenced by vm_call_cfunc().

static VALUE vm_call_general | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1914 of file vm_insnhelper.c.

References vm_call_method().

Referenced by vm_search_method().

static VALUE vm_call_iseq_setup | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1242 of file vm_insnhelper.c.

References rb_call_info_struct::argc, rb_method_definition_struct::body, rb_method_entry_struct::def, rb_method_definition_struct::iseq, rb_call_info_struct::me, rb_control_frame_struct::sp, vm_call_iseq_setup_2(), and VM_CALLEE_SETUP_ARG.

Referenced by vm_call0_body(), and vm_call_method().

static VALUE vm_call_iseq_setup_2 | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1249 of file vm_insnhelper.c.

References rb_call_info_struct::flag, LIKELY, vm_call_iseq_setup_normal(), vm_call_iseq_setup_tailcall(), and VM_CALL_TAILCALL.

Referenced by vm_call_iseq_setup().

static VALUE vm_call_iseq_setup_normal | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| inline static

Definition at line 1260 of file vm_insnhelper.c.

References rb_iseq_struct::arg_size, rb_call_info_struct::argc, argv, rb_call_info_struct::aux, rb_call_info_struct::blockptr, rb_method_definition_struct::body, CHECK_VM_STACK_OVERFLOW, rb_method_entry_struct::def, rb_call_info_struct::defined_class, i, iseq_catch_table_entry::iseq, rb_method_definition_struct::iseq, rb_iseq_struct::iseq_encoded, rb_iseq_struct::local_size, rb_call_info_struct::me, rb_call_info_struct::opt_pc, Qnil, Qundef, rb_call_info_struct::recv, iseq_catch_table_entry::sp, rb_control_frame_struct::sp, rb_iseq_struct::stack_max, VM_ENVVAL_BLOCK_PTR, VM_FRAME_MAGIC_METHOD, and vm_push_frame().

Referenced by vm_call_iseq_setup_2().

static VALUE vm_call_iseq_setup_tailcall | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| inline static

Definition at line 1283 of file vm_insnhelper.c.

References rb_iseq_struct::arg_size, rb_call_info_struct::argc, argv, rb_call_info_struct::aux, rb_call_info_struct::blockptr, rb_method_definition_struct::body, rb_thread_struct::cfp, CHECK_VM_STACK_OVERFLOW, rb_method_entry_struct::def, rb_call_info_struct::defined_class, i, iseq_catch_table_entry::iseq, rb_method_definition_struct::iseq, rb_iseq_struct::iseq_encoded, rb_iseq_struct::local_size, rb_call_info_struct::me, rb_call_info_struct::opt_pc, Qnil, Qundef, rb_call_info_struct::recv, RUBY_VM_CHECK_INTS, RUBY_VM_PREVIOUS_CONTROL_FRAME, iseq_catch_table_entry::sp, rb_control_frame_struct::sp, rb_iseq_struct::stack_max, VM_ENVVAL_BLOCK_PTR, VM_FRAME_FLAG_FINISH, VM_FRAME_MAGIC_METHOD, VM_FRAME_TYPE_FINISH_P, and vm_push_frame().

Referenced by vm_call_iseq_setup_2().

static VALUE vm_call_ivar | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1569 of file vm_insnhelper.c.

References rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_method_entry_struct::def, rb_method_attr_struct::id, rb_call_info_struct::me, rb_call_info_struct::recv, rb_control_frame_struct::sp, val, and vm_getivar().

Referenced by vm_call_method().

static VALUE vm_call_method | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| inline static

Definition at line 1739 of file vm_insnhelper.c.

References rb_call_info_struct::argc, rb_call_info_struct::aux, rb_method_definition_struct::body, rb_call_info_struct::call, CI_SET_FASTPATH, current_method_entry(), rb_method_entry_struct::def, rb_call_info_struct::defined_class, rb_control_frame_struct::ep, find_refinement(), rb_method_entry_struct::flag, rb_call_info_struct::flag, rb_call_info_struct::index, rb_control_frame_struct::iseq, rb_method_entry_struct::klass, klass, rb_call_info_struct::me, rb_control_frame_struct::me, rb_call_info_struct::mid, rb_call_info_struct::missing_reason, NIL_P(), NOEX_MASK, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_SAFE, NOEX_SUPER, NOEX_VCALL, rb_method_definition_struct::optimize_type, rb_method_definition_struct::orig_me, Qnil, rb_bug(), rb_check_arity, rb_eSecurityError, rb_id2name(), rb_method_definition_eq(), rb_method_entry(), rb_obj_is_kind_of(), rb_raise(), rb_raise_method_missing(), rb_vm_get_cref(), RCLASS_ORIGIN, RCLASS_SUPER, rb_call_info_struct::recv, rb_thread_struct::safe_level, rb_control_frame_struct::self, STACK_ADDR_FROM_TOP, stat, rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, VM_CALL_ARGS_SPLAT, vm_call_attrset(), vm_call_bmethod(), vm_call_cfunc(), VM_CALL_FCALL, vm_call_iseq_setup(), vm_call_ivar(), vm_call_method_missing(), vm_call_opt_call(), VM_CALL_OPT_SEND, vm_call_opt_send(), VM_CALL_SUPER, vm_call_super_method(), VM_CALL_VCALL, 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_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.

Referenced by vm_call_general(), vm_call_method_missing(), vm_call_opt_send(), and vm_call_super_method().

static VALUE vm_call_method_missing | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1678 of file vm_insnhelper.c.

References rb_call_info_struct::argc, rb_call_info_struct::aux, rb_call_info_struct::blockptr, CHECK_VM_STACK_OVERFLOW, CLASS_OF, rb_call_info_struct::defined_class, rb_call_info_struct::flag, ID2SYM, INC_SP, rb_call_info_struct::me, MEMMOVE, rb_thread_struct::method_missing_reason, rb_call_info_struct::mid, rb_call_info_struct::missing_reason, rb_method_entry(), rb_call_info_struct::recv, STACK_ADDR_FROM_TOP, VM_CALL_FCALL, vm_call_method(), and VM_CALL_OPT_SEND.

Referenced by vm_call_method().

static VALUE vm_call_opt_call | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1665 of file vm_insnhelper.c.

References ALLOCA_N, rb_call_info_struct::argc, rb_call_info_struct::blockptr, GetProcPtr, MEMCPY, proc, rb_vm_invoke_proc(), rb_call_info_struct::recv, and rb_control_frame_struct::sp.

Referenced by vm_call_method().

static VALUE vm_call_opt_send | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1623 of file vm_insnhelper.c.

References rb_call_info_struct::argc, CLASS_OF, DEC_SP, rb_call_info_struct::defined_class, exc, rb_call_info_struct::flag, i, make_no_method_exception(), rb_call_info_struct::me, MEMMOVE, rb_call_info_struct::mid, NULL, rb_check_id(), rb_eArgError, rb_eNoMethodError, rb_exc_raise(), rb_long2int, rb_method_basic_definition_p(), rb_method_entry_without_refinements(), rb_raise(), rb_to_id(), rb_call_info_struct::recv, sym, SYM2ID, SYMBOL_P, TOPN, VM_CALL_FCALL, vm_call_method(), and VM_CALL_OPT_SEND.

Referenced by vm_call_method().

static VALUE vm_call_super_method | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1920 of file vm_insnhelper.c.

References vm_call_method().

Referenced by vm_call_method(), and vm_search_super_method().

static int vm_callee_setup_arg_complex | ( | rb_thread_t * | th,
|  | rb_call_info_t * | ci,
|  | const rb_iseq_t * | iseq,
|  | VALUE * | orig_argv
| ) |  |
| inline static

Definition at line 1132 of file vm_insnhelper.c.

References ALLOCA_N, rb_iseq_struct::arg_block, rb_iseq_struct::arg_keyword, 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, rb_call_info_struct::argc, rb_iseq_struct::argc, argc, argument_error(), argv, rb_proc_t::block, rb_call_info_struct::blockptr, GetProcPtr, i, if(), m, rb_thread_struct::mark_stack_len, max(), MEMCPY, min(), opts, rb_block_struct::proc, proc, Qnil, rb_ary_new4(), rb_cProc, rb_vm_make_proc(), UNLIMITED_ARGUMENTS, and vm_callee_setup_keyword_arg().

static int vm_callee_setup_keyword_arg | ( | const rb_iseq_t * | iseq,
|  | int | argc,
|  | int | m,
|  | VALUE * | orig_argv,
|  | VALUE * | kwd
| ) |  |
| inline static

Definition at line 1099 of file vm_insnhelper.c.

References rb_iseq_struct::arg_keyword_check, rb_iseq_struct::arg_keyword_table, rb_iseq_struct::arg_keywords, argc, extract_keywords(), i, ID2SYM, NIL_P(), rb_check_hash_type(), rb_hash_new(), RHASH_TBL, st_lookup(), and unknown_keyword_error().

Referenced by vm_callee_setup_arg_complex(), and vm_yield_setup_block_args().

static void vm_caller_setup_args | ( | const rb_thread_t * | th,
|  | rb_control_frame_t * | cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1006 of file vm_insnhelper.c.

References rb_call_info_struct::argc, ary, b, rb_proc_t::block, rb_call_info_struct::blockiseq, rb_call_info_struct::blockptr, CHECK_VM_STACK_OVERFLOW, rb_call_info_struct::flag, GetProcPtr, i, rb_block_struct::iseq, len, NIL_P(), rb_block_struct::proc, proc, ptr, 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, SAVE_RESTORE_CI, rb_control_frame_struct::sp, T_ARRAY, T_DATA, tmp, UNLIKELY, VM_CALL_ARGS_BLOCKARG, and VM_CALL_ARGS_SPLAT.

Referenced by vm_invoke_block().

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

Definition at line 353 of file vm_insnhelper.c.

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

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 297 of file vm_insnhelper.c.

References rb_thread_struct::cfp, COPY_CREF_OMOD, rb_control_frame_struct::ep, rb_block_struct::ep, rb_control_frame_struct::iseq, rb_block_struct::iseq, NEW_CREF, NIL_P(), Qnil, 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 781 of file vm_insnhelper.c.

References i, len, ptr, Qnil, RARRAY_LEN, RARRAY_PTR(), rb_ary_new(), rb_ary_new4(), rb_ary_to_ary(), RB_GC_GUARD, RB_TYPE_P, rb_control_frame_struct::sp, T_ARRAY, and v.

static VALUE vm_get_cbase | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | ep
| ) |  |
| inline static

Definition at line 320 of file vm_insnhelper.c.

References klass, Qundef, and rb_vm_get_cref().

Referenced by rb_vm_cbase().

static VALUE vm_get_const_base | ( | const rb_iseq_t * | iseq,
|  | const VALUE * | ep
| ) |  |
| inline static

Definition at line 336 of file vm_insnhelper.c.

References RNode::flags, klass, NODE_FL_CREF_PUSHED_BY_EVAL, Qundef, and rb_vm_get_cref().

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

Definition at line 271 of file vm_insnhelper.c.

References rb_iseq_struct::cref_stack, NULL, Qnil, RUBY_VM_NORMAL_ISEQ_P, VM_EP_LEP_P, and VM_EP_PREV_EP.

Referenced by rb_vm_get_cref(), and vm_cref_push().

static VALUE vm_get_cvar_base | ( | NODE * | cref,
|  | rb_control_frame_t * | cfp
| ) |  |
| inline static

Definition at line 456 of file vm_insnhelper.c.

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

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 378 of file vm_insnhelper.c.

References av, rb_thread_struct::cfp, CLASS_OF, data, rb_control_frame_struct::ep, RNode::flags, klass, NIL_P(), NODE_FL_CREF_PUSHED_BY_EVAL, Qnil, Qundef, rb_autoload_load(), rb_autoloading_value(), rb_const_defined(), rb_const_get(), rb_public_const_defined_from(), rb_public_const_get_from(), rb_vm_get_cref(), RCLASS_CONST_TBL, rb_control_frame_struct::self, st_lookup(), val, vm_check_if_namespace(), and vm_get_iclass().

static VALUE vm_get_iclass | ( | rb_control_frame_t * | cfp,
|  | VALUE | klass
| ) |  |
| inline static

Definition at line 364 of file vm_insnhelper.c.

References FL_TEST, rb_control_frame_struct::klass, klass, RB_TYPE_P, RBASIC, RMODULE_IS_OVERLAID, T_ICLASS, and T_MODULE.

Referenced by vm_get_cvar_base(), and vm_get_ev_const().

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_getinstancevariable | ( | VALUE | obj,
|  | ID | id,
|  | IC | ic
| ) |  |
| static

Definition at line 599 of file vm_insnhelper.c.

References vm_getivar().

static VALUE vm_getivar | ( | VALUE | obj,
|  | ID | id,
|  | IC | ic,
|  | rb_call_info_t * | ci,
|  | int | is_attr
| ) |  |
| inline static

Definition at line 500 of file vm_insnhelper.c.

References rb_call_info_struct::aux, 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, rb_call_info_struct::index, index, klass, len, LIKELY, ptr, Qnil, Qundef, rb_attr_get(), rb_id2name(), rb_ivar_get(), RB_TYPE_P, rb_warning(), RBASIC, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_lookup(), T_OBJECT, UNLIKELY, and val.

Referenced by vm_call_ivar(), and vm_getinstancevariable().

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

Definition at line 235 of file vm_insnhelper.c.

References lep_svar_get(), rb_bug(), rb_reg_last_match(), rb_reg_match_last(), rb_reg_match_post(), rb_reg_match_pre(), rb_reg_nth_match(), and val.

static VALUE vm_invoke_block | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 2306 of file vm_insnhelper.c.

References rb_iseq_struct::arg_size, rb_call_info_struct::argc, block, block_proc_is_lambda(), BUILTIN_TYPE, CHECK_VM_STACK_OVERFLOW, rb_block_struct::ep, rb_call_info_struct::flag, GET_CFP, GET_ISEQ, GET_SP, iseq_catch_table_entry::iseq, rb_block_struct::iseq, rb_iseq_struct::iseq_encoded, rb_block_struct::klass, 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, UNLIKELY, val, VM_CALL_ARGS_SPLAT, vm_caller_setup_args(), VM_CF_BLOCK_PTR(), VM_ENVVAL_PREV_EP_PTR, VM_FRAME_MAGIC_BLOCK, vm_push_frame(), vm_yield_setup_args(), and vm_yield_with_cfunc().

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

Definition at line 99 of file vm_insnhelper.c.

References rb_thread_struct::cfp, RUBY_VM_PREVIOUS_CONTROL_FRAME, SDR, and VMDEBUG.

Referenced by rb_vm_call_cfunc(), vm_call0_cfunc_with_frame(), vm_call_cfunc_with_frame(), 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 | klass,
|  | VALUE | specval,
|  | const VALUE * | pc,
|  | VALUE * | sp,
|  | int | local_size,
|  | const rb_method_entry_t * | me
| ) |  |
| inline static

Definition at line 34 of file vm_insnhelper.c.

References rb_control_frame_struct::block_iseq, rb_thread_struct::cfp, rb_control_frame_struct::ep, rb_control_frame_struct::flag, i, rb_control_frame_struct::iseq, rb_control_frame_struct::klass, klass, rb_control_frame_struct::me, rb_control_frame_struct::pc, rb_control_frame_struct::proc, Qnil, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, SDR, rb_control_frame_struct::self, rb_control_frame_struct::sp, type, vm_stackoverflow(), and VMDEBUG.

Referenced by invoke_block_from_c(), rb_vm_call_cfunc(), th_init(), vm_call0_cfunc_with_frame(), vm_call_cfunc_with_frame(), vm_call_iseq_setup_normal(), vm_call_iseq_setup_tailcall(), vm_exec(), vm_invoke_block(), vm_set_eval_stack(), vm_set_top_stack(), and vm_yield_with_cfunc().

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

Definition at line 482 of file vm_insnhelper.c.

References rb_cObject, rb_const_defined_at(), RCLASS_SUPER, and tmp.

static void vm_search_method | ( | rb_call_info_t * | ci,
|  | VALUE | recv
| ) |  |
| static

Definition at line 843 of file vm_insnhelper.c.

References rb_call_info_struct::call, CLASS_OF, rb_call_info_struct::defined_class, GET_VM_STATE_VERSION, rb_call_info_struct::klass, klass, LIKELY, rb_call_info_struct::me, rb_call_info_struct::mid, rb_method_entry(), vm_call_general(), and rb_call_info_struct::vmstat.

Referenced by opt_eq_func().

static VALUE vm_search_normal_superclass | ( | VALUE | klass | ) |
| inline static

Definition at line 1928 of file vm_insnhelper.c.

References BUILTIN_TYPE, FL_TEST, RBASIC, RCLASS_ORIGIN, RCLASS_SUPER, RMODULE_IS_REFINEMENT, and T_ICLASS.

Referenced by vm_search_superclass().

static void vm_search_super_method | ( | rb_thread_t * | th,
|  | rb_control_frame_t * | reg_cfp,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1996 of file vm_insnhelper.c.

References rb_call_info_struct::argc, rb_method_definition_struct::body, rb_call_info_struct::call, rb_method_entry_struct::def, rb_call_info_struct::defined_class, FL_TEST, GET_CFP, GET_ISEQ, iseq_catch_table_entry::iseq, rb_method_definition_struct::iseq, rb_call_info_struct::klass, rb_iseq_struct::klass, m, rb_call_info_struct::me, rb_call_info_struct::mid, NIL_P(), rb_iseq_struct::parent_iseq, rb_class2name(), rb_eRuntimeError, rb_eTypeError, rb_method_entry(), rb_obj_classname(), rb_obj_is_kind_of(), rb_raise(), RB_TYPE_P, RBASIC, RCLASS_REFINED_CLASS, RCLASS_SUPER, rb_call_info_struct::recv, RMODULE_INCLUDED_INTO_REFINEMENT, T_ICLASS, TOPN, rb_method_definition_struct::type, vm_call_super_method(), VM_METHOD_TYPE_ISEQ, vm_search_superclass(), and vm_super_outside().

static int vm_search_superclass | ( | rb_control_frame_t * | reg_cfp,
|  | rb_iseq_t * | iseq,
|  | VALUE | sigval,
|  | rb_call_info_t * | ci
| ) |  |
| static

Definition at line 1945 of file vm_insnhelper.c.

References rb_method_entry_struct::def, rb_iseq_struct::defined_method_id, rb_control_frame_struct::ep, GET_CFP, GET_THREAD(), rb_control_frame_struct::iseq, rb_call_info_struct::klass, rb_iseq_struct::klass, rb_control_frame_struct::klass, rb_iseq_struct::local_iseq, rb_control_frame_struct::me, rb_call_info_struct::mid, rb_method_definition_struct::original_id, rb_iseq_struct::parent_iseq, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, VM_EP_PREV_EP, and vm_search_normal_superclass().

Referenced by vm_search_super_method().

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

Definition at line 605 of file vm_insnhelper.c.

References vm_setivar().

static VALUE vm_setivar | ( | VALUE | obj,
|  | ID | id,
|  | VALUE | val,
|  | IC | ic,
|  | rb_call_info_t * | ci,
|  | int | is_attr
| ) |  |
| inline static

Definition at line 553 of file vm_insnhelper.c.

References rb_call_info_struct::aux, 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, rb_call_info_struct::index, index, klass, len, LIKELY, OBJ_UNTRUSTED, ptr, rb_check_frozen, rb_eSecurityError, rb_ivar_set(), rb_raise(), rb_safe_level, RB_TYPE_P, RBASIC, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, st_lookup(), T_OBJECT, and val.

Referenced by vm_call_attrset(), and vm_setinstancevariable().

static void vm_stackoverflow | ( | void |  | ) |
| static

Definition at line 28 of file vm_insnhelper.c.

References rb_exc_raise(), and sysstack_error.

Referenced by vm_push_frame().

static void vm_super_outside | ( | void |  | ) |
| static

Definition at line 1939 of file vm_insnhelper.c.

References rb_eNoMethodError, and rb_raise().

Referenced by vm_search_super_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 611 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, iseq_catch_table_entry::end, rb_control_frame_struct::ep, err, FIX2INT, FIXNUM_P, flag, GC_GUARDED_PTR_REF, GET_CFP, GET_EP, GET_ISEQ, GET_THROWOBJ_STATE, i, int, rb_control_frame_struct::iseq, rb_iseq_struct::iseq_encoded, level, NEW_THROW_OBJECT, rb_iseq_struct::parent_iseq, rb_control_frame_struct::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, 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_CF_LEP(), VM_EP_PREV_EP, 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 2277 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_call_info_struct::argc, rb_iseq_struct::argc, argc, rb_call_info_struct::aux, rb_call_info_struct::blockptr, rb_call_info_struct::flag, rb_call_info_struct::opt_pc, 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 2166 of file vm_insnhelper.c.

References rb_iseq_struct::arg_block, rb_iseq_struct::arg_keyword, 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, ary, rb_thread_struct::cfp, CHECK_VM_STACK_OVERFLOW, i, m, rb_thread_struct::mark_stack_len, MEMCPY, NIL_P(), rb_block_struct::proc, Qnil, r, RARRAY_LENINT, RARRAY_PTR(), rb_ary_new(), rb_ary_new4(), rb_check_array_type(), rb_cProc, rb_vm_make_proc(), vm_callee_setup_keyword_arg(), 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 2109 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, ary, i, len, m, MEMMOVE, opts, Qnil, r, rb_ary_new4(), and iseq_catch_table_entry::start.

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 2063 of file vm_insnhelper.c.

References arg, block_proc_is_lambda(), rb_thread_struct::cfp, rb_block_struct::ep, rb_block_struct::iseq, rb_block_struct::proc, Qnil, rb_ary_new4(), rb_cProc, rb_vm_make_proc(), rb_control_frame_struct::sp, val, VM_ENVVAL_PREV_EP_PTR, VM_FRAME_MAGIC_IFUNC, and vm_push_frame().

Referenced by invoke_block_from_c(), and vm_invoke_block().