Ruby
2.0.0p247(2013-06-27revision41674)
|
#include "insns.inc"
#include <math.h>
#include "constant.h"
#include "internal.h"
#include "probes.h"
#include "probes_helper.h"
Go to the source code of this file.
#define CHECK_CMP_NAN | ( | a, | |
b | |||
) | /* do nothing */ |
Definition at line 944 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 | |||
) |
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)
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 | |||
) |
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)); \ }
Definition at line 1223 of file vm_insnhelper.c.
Referenced by vm_call_iseq_setup(), and vm_yield_setup_args().
#define VM_PROFILE 0 |
Definition at line 1425 of file vm_insnhelper.c.
#define VM_PROFILE_ATEXIT | ( | ) |
Definition at line 1442 of file vm_insnhelper.c.
Referenced by Init_VM().
#define VM_PROFILE_UP | ( | x | ) |
Definition at line 1441 of file vm_insnhelper.c.
Referenced by vm_call0_cfunc_with_frame(), and vm_call_cfunc_with_frame().
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 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 2035 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_0 | ( | VALUE(*)(ANYARGS) | func, |
VALUE | recv, | ||
int | argc, | ||
const VALUE * | argv | ||
) | [static] |
Definition at line 1329 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 1335 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 1389 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 1395 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 1401 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 1407 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 1413 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 1419 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 1341 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 1347 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 1353 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 1359 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 1365 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 1371 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 1377 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 1383 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 1323 of file vm_insnhelper.c.
static VALUE call_cfunc_m2 | ( | VALUE(*)(ANYARGS) | func, |
VALUE | recv, | ||
int | argc, | ||
const VALUE * | argv | ||
) | [static] |
Definition at line 1317 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 922 of file vm_insnhelper.c.
References idEqq, rb_bug(), rb_cModule, rb_eTypeError, rb_funcall2(), rb_obj_is_kind_of(), rb_raise(), RTEST, 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 1710 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 969 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 962 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 955 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 948 of file vm_insnhelper.c.
References CHECK_CMP_NAN, Qfalse, and Qtrue.
static VALUE extract_keywords | ( | VALUE * | orighash | ) | [static] |
Definition at line 1079 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 1698 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 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 DEFAULT_SPECIAL_VAR_COUNT, lep_svar_place(), NIL_P, rb_ary_new(), rb_ary_store(), 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 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 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().
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 1068 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, ID2SYM, 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 976 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_call_attrset | ( | rb_thread_t * | th, |
rb_control_frame_t * | cfp, | ||
rb_call_info_t * | ci | ||
) | [static] |
Definition at line 1572 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, 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 1600 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 1580 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, Qnil, rb_call_info_struct::recv, RUBY_DTRACE_METHOD_ENTRY_HOOK, RUBY_DTRACE_METHOD_RETURN_HOOK, RUBY_EVENT_CALL, RUBY_EVENT_RETURN, 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 1557 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 1446 of file vm_insnhelper.c.
References rb_method_cfunc_struct::argc, argc, rb_call_info_struct::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, 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 1900 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 1237 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 1244 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 1255 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, 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 1278 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, 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 1564 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, 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 1734 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, 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_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, 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 1673 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 1660 of file vm_insnhelper.c.
References ALLOCA_N, rb_call_info_struct::argc, rb_call_info_struct::blockptr, GetProcPtr, MEMCPY, 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 1618 of file vm_insnhelper.c.
References rb_call_info_struct::argc, CLASS_OF, DEC_SP, rb_call_info_struct::defined_class, rb_call_info_struct::flag, 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 1906 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 1127 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, argc, rb_call_info_struct::argc, rb_iseq_struct::argc, argument_error(), argv, rb_proc_t::block, rb_call_info_struct::blockptr, GetProcPtr, if(), rb_thread_struct::mark_stack_len, max(), MEMCPY, rb_block_struct::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 1094 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(), 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 1001 of file vm_insnhelper.c.
References rb_call_info_struct::argc, rb_proc_t::block, rb_call_info_struct::blockiseq, rb_call_info_struct::blockptr, CHECK_VM_STACK_OVERFLOW, rb_call_info_struct::flag, GetProcPtr, rb_block_struct::iseq, 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, SAVE_RESTORE_CI, rb_control_frame_struct::sp, T_ARRAY, T_DATA, 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, 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 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, and T_ARRAY.
Definition at line 320 of file vm_insnhelper.c.
References Qundef, and rb_vm_get_cref().
Referenced by rb_vm_cbase().
Definition at line 336 of file vm_insnhelper.c.
References RNode::flags, NODE_FL_CREF_PUSHED_BY_EVAL, Qundef, and rb_vm_get_cref().
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, 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 rb_thread_struct::cfp, CLASS_OF, rb_control_frame_struct::ep, RNode::flags, 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, RNode::value, 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, 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, LIKELY, 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 2292 of file vm_insnhelper.c.
References rb_iseq_struct::arg_size, rb_call_info_struct::argc, 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, 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_thread_struct::cfp, rb_method_entry_struct::klass, rb_control_frame_struct::klass, Qnil, RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, SDR, 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(), and RCLASS_SUPER.
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, 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 1914 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 1982 of file vm_insnhelper.c.
References 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, rb_call_info_struct::me, rb_call_info_struct::mid, NIL_P, rb_call_info_struct::orig_argc, 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 1931 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, LIKELY, OBJ_UNTRUSTED, 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(), and T_OBJECT.
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 1925 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, GC_GUARDED_PTR_REF, GET_CFP, GET_EP, GET_ISEQ, GET_THROWOBJ_STATE, 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, 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 2263 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, argc, rb_call_info_struct::argc, rb_iseq_struct::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 2152 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, argc, rb_iseq_struct::argc, rb_thread_struct::cfp, CHECK_VM_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(), 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 2095 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, MEMMOVE, Qnil, 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 2049 of file vm_insnhelper.c.
References 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, VM_ENVVAL_PREV_EP_PTR, VM_FRAME_MAGIC_IFUNC, and vm_push_frame().
Referenced by invoke_block_from_c(), and vm_invoke_block().