Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#include "ruby/internal/config.h"
#include <math.h>
#include "constant.h"
#include "debug_counter.h"
#include "internal.h"
#include "internal/class.h"
#include "internal/compar.h"
#include "internal/hash.h"
#include "internal/numeric.h"
#include "internal/proc.h"
#include "internal/random.h"
#include "internal/variable.h"
#include "variable.h"
#include "insns.inc"
#include "insns_info.inc"
#include "vm_args.c"
Go to the source code of this file.
Macros | |
#define | vm_check_canary(ec, sp) |
#define | vm_check_frame(a, b, c, d) |
#define | vm_push_frame_debug_counter_inc(ec, cfp, t) /* void */ |
#define | EQ_UNREDEFINED_P(t) BASIC_OP_UNREDEFINED_P(BOP_EQ, t##_REDEFINED_OP_FLAG) |
#define | CHECK_CMP_NAN(a, b) /* do nothing */ |
#define | USE_OPT_HIST 0 |
#define | CHECK_CFP_CONSISTENCY(func) |
#define | id_cmp idCmp |
#define | IMEMO_CONST_CACHE_SHAREABLE IMEMO_FL_USER0 |
#define | VM_TRACE_HOOK(target_event, val) |
Typedefs | |
typedef VALUE(* | builtin_invoker) (rb_execution_context_t *ec, VALUE self, const VALUE *argv, rb_insn_func_t funcptr) |
Enumerations | |
enum | method_explorer_type { mexp_search_method , mexp_search_invokeblock , mexp_search_super } |
#define CHECK_CFP_CONSISTENCY | ( | func | ) |
Definition at line 2865 of file vm_insnhelper.c.
#define CHECK_CMP_NAN | ( | a, | |
b | |||
) | /* do nothing */ |
Definition at line 2056 of file vm_insnhelper.c.
#define EQ_UNREDEFINED_P | ( | t | ) | BASIC_OP_UNREDEFINED_P(BOP_EQ, t##_REDEFINED_OP_FLAG) |
Definition at line 1866 of file vm_insnhelper.c.
#define id_cmp idCmp |
Definition at line 4587 of file vm_insnhelper.c.
#define IMEMO_CONST_CACHE_SHAREABLE IMEMO_FL_USER0 |
Definition at line 4643 of file vm_insnhelper.c.
#define USE_OPT_HIST 0 |
Definition at line 2259 of file vm_insnhelper.c.
#define vm_check_canary | ( | ec, | |
sp | |||
) |
Definition at line 290 of file vm_insnhelper.c.
#define vm_check_frame | ( | a, | |
b, | |||
c, | |||
d | |||
) |
Definition at line 291 of file vm_insnhelper.c.
#define vm_push_frame_debug_counter_inc | ( | ec, | |
cfp, | |||
t | |||
) | /* void */ |
Definition at line 341 of file vm_insnhelper.c.
#define VM_TRACE_HOOK | ( | target_event, | |
val | |||
) |
Definition at line 5314 of file vm_insnhelper.c.
typedef VALUE(* builtin_invoker) (rb_execution_context_t *ec, VALUE self, const VALUE *argv, rb_insn_func_t funcptr) |
Definition at line 5550 of file vm_insnhelper.c.
enum method_explorer_type |
Enumerator | |
---|---|
mexp_search_method | |
mexp_search_invokeblock | |
mexp_search_super |
Definition at line 4485 of file vm_insnhelper.c.
void Init_vm_stack_canary | ( | void | ) |
Definition at line 5410 of file vm_insnhelper.c.
void rb_ec_stack_overflow | ( | rb_execution_context_t * | ec, |
int | crit | ||
) |
Definition at line 84 of file vm_insnhelper.c.
References EC_JUMP_TAG, rb_execution_context_struct::errinfo, FALSE, rb_execution_context_struct::raised_flag, RAISED_STACKOVERFLOW, rb_bug(), rb_during_gc(), ruby_error_stackfatal, TAG_RAISE, and TRUE.
Definition at line 442 of file vm_insnhelper.c.
References argc, max, and rb_exc_raise().
Definition at line 3011 of file vm_insnhelper.c.
References FL_TEST, RBASIC_CLASS, RCLASS_SUPER, RICLASS_IS_ORIGIN, RTEST, T_CLASS, and T_ICLASS.
rb_event_flag_t rb_iseq_event_flags | ( | const rb_iseq_t * | iseq, |
size_t | pos | ||
) |
Definition at line 1834 of file iseq.c.
References iseq_insn_info_entry::events.
Referenced by rb_iseq_disasm_insn(), and rb_iseq_trace_set().
VALUE rb_make_no_method_exception | ( | VALUE | exc, |
VALUE | format, | ||
VALUE | obj, | ||
int | argc, | ||
const VALUE * | argv, | ||
int | priv | ||
) |
Definition at line 886 of file vm_eval.c.
References argc, argv, name, rb_ary_new4, rb_eNoMethodError, rb_fstring_lit, rb_name_err_new(), and rb_nomethod_err_new().
rb_method_definition_t * rb_method_definition_create | ( | rb_method_type_t | type, |
ID | mid | ||
) |
Definition at line 546 of file vm_method.c.
Referenced by rb_method_entry_complement_defined_class().
int rb_method_definition_eq | ( | const rb_method_definition_t * | d1, |
const rb_method_definition_t * | d2 | ||
) |
Definition at line 1849 of file vm_method.c.
References rb_method_cfunc_struct::argc, rb_method_definition_struct::attr, rb_method_definition_struct::bmethod, rb_method_definition_struct::body, rb_method_definition_struct::cfunc, d1, rb_method_cfunc_struct::func, rb_method_attr_struct::id, rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, rb_method_definition_struct::optimize_type, rb_method_definition_struct::original_id, rb_method_bmethod_struct::proc, rb_bug(), rb_equal(), RTEST, VM_METHOD_TYPE_ALIAS, 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 rb_method_entry_eq().
void rb_method_definition_set | ( | const rb_method_entry_t * | me, |
rb_method_definition_t * | def, | ||
void * | opts | ||
) |
Definition at line 428 of file vm_method.c.
References rb_method_cfunc_struct::argc, rb_execution_context_struct::cfp, rb_method_iseq_struct::cref, def(), rb_method_entry_struct::def, rb_method_cfunc_struct::func, if(), INT2FIX, rb_control_frame_struct::iseq, rb_method_iseq_struct::iseqptr, NULL, rb_method_refined_struct::orig_me, rb_method_refined_struct::owner, rb_ary_freeze(), rb_ary_new3, rb_f_notimplement(), rb_iseq_path(), RB_OBJ_WRITE, rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), UNALIGNED_MEMBER_PTR, VM_ASSERT, VM_METHOD_TYPE_ALIAS, 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 rb_method_entry_complement_defined_class().
Definition at line 2152 of file vm_insnhelper.c.
References rb_iseq_constant_body::accepts_no_kwarg, rb_iseq_struct::body, FALSE, rb_iseq_constant_body::flags, rb_iseq_constant_body::has_block, rb_iseq_constant_body::has_kw, rb_iseq_constant_body::has_kwrest, rb_iseq_constant_body::has_opt, rb_iseq_constant_body::has_post, rb_iseq_constant_body::has_rest, and rb_iseq_constant_body::param.
bool rb_splat_or_kwargs_p | ( | const struct rb_callinfo *restrict | ci | ) |
Definition at line 2188 of file vm_insnhelper.c.
References IS_ARGS_KW_OR_KW_SPLAT, and IS_ARGS_SPLAT.
VALUE rb_vm_bh_to_procval | ( | const rb_execution_context_t * | ec, |
VALUE | block_handler | ||
) |
Definition at line 474 of file vm_insnhelper.c.
References block_handler_type_ifunc, block_handler_type_iseq, block_handler_type_proc, block_handler_type_symbol, Qnil, rb_cProc, rb_sym_to_proc(), rb_vm_bh_to_procval(), VM_BLOCK_HANDLER_NONE, and VM_UNREACHABLE.
Referenced by rb_vm_bh_to_procval().
VALUE rb_vm_call0 | ( | rb_execution_context_t * | ec, |
VALUE | recv, | ||
ID | id, | ||
int | argc, | ||
const VALUE * | argv, | ||
const rb_callable_method_entry_t * | cme, | ||
int | kw_splat | ||
) |
Definition at line 46 of file vm_eval.c.
References argc, argv, rb_calling_info::block_handler, rb_calling_info::ci, rb_calling_info::kw_splat, NULL, Qfalse, rb_calling_info::recv, VM_CALL_KW_SPLAT, VM_CC_ON_STACK, and VM_CI_ON_STACK.
Referenced by rb_check_funcall_basic_kw(), and rb_vm_call_kw().
const rb_callable_method_entry_t * rb_vm_frame_method_entry | ( | const rb_control_frame_t * | cfp | ) |
Definition at line 667 of file vm_insnhelper.c.
References rb_control_frame_struct::ep, FALSE, NULL, TRUE, and VM_ENV_DATA_INDEX_ME_CREF.
Referenced by rb_profile_frames(), rb_raise_jump(), rb_vm_control_frame_id_and_class(), and rb_vm_pop_cfunc_frame().
VALUE rb_vm_lvar_exposed | ( | rb_execution_context_t * | ec, |
int | index | ||
) |
Definition at line 5617 of file vm_insnhelper.c.
References rb_execution_context_struct::cfp, and rb_control_frame_struct::ep.
bool rb_vm_opt_cfunc_p | ( | CALL_CACHE | cc, |
int | insn | ||
) |
Definition at line 5300 of file vm_insnhelper.c.
References rb_false(), rb_obj_equal(), and rb_obj_not().
void rb_vm_pop_frame | ( | rb_execution_context_t * | ec | ) |
Definition at line 419 of file vm_insnhelper.c.
References rb_execution_context_struct::cfp, and rb_control_frame_struct::ep.
Referenced by rb_binding_add_dynavars(), rb_exec_event_hooks(), rb_raise_jump(), rb_vm_call_cfunc(), and rb_vm_rewind_cfp().
void rb_vm_rewrite_cref | ( | rb_cref_t * | cref, |
VALUE | old_klass, | ||
VALUE | new_klass, | ||
rb_cref_t ** | new_cref_ptr | ||
) |
Definition at line 867 of file vm_insnhelper.c.
References FALSE, METHOD_VISI_UNDEF, rb_cref_struct::next, and NULL.
const struct rb_callcache * rb_vm_search_method_slowpath | ( | const struct rb_callinfo * | ci, |
VALUE | klass | ||
) |
Definition at line 1729 of file vm_insnhelper.c.
References imemo_callcache, IMEMO_TYPE_P, rb_callcache::klass, METHOD_ENTRY_INVALIDATED, RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, T_CLASS, T_ICLASS, VM_ASSERT, and vm_cc_empty.
Definition at line 48 of file vm_insnhelper.c.
References rb_class_real(), rb_obj_alloc(), rb_obj_copy_ivar(), and RBASIC_CLASS.
Referenced by rb_memerror(), and rb_threadptr_execute_interrupts().
STATIC_ASSERT | ( | VM_ENV_DATA_INDEX_FLAGS | , |
VM_ENV_DATA_INDEX_FLAGS | = =-0 |
||
) |
STATIC_ASSERT | ( | VM_ENV_DATA_INDEX_ME_CREF | , |
VM_ENV_DATA_INDEX_ME_CREF | = =-2 |
||
) |
STATIC_ASSERT | ( | VM_ENV_DATA_INDEX_SPECVAL | , |
VM_ENV_DATA_INDEX_SPECVAL | = =-1 |
||
) |