16#include "internal/error.h"
17#include "internal/eval.h"
20#include "internal/symbol.h"
24#if !defined(__GNUC__) || __GNUC__ < 5 || defined(__MINGW32__)
25# define NO_CLOBBERED(v) (*(volatile VALUE *)&(v))
27# define NO_CLOBBERED(v) (v)
30#define UPDATE_TYPED_REFERENCE(_type, _ref) *(_type*)&_ref = (_type)rb_gc_location((VALUE)_ref)
31#define UPDATE_REFERENCE(_ref) UPDATE_TYPED_REFERENCE(VALUE, _ref)
49static int method_arity(
VALUE);
50static int method_min_max_arity(
VALUE,
int *
max);
53#define attached id__attached__
57#define IS_METHOD_PROC_IFUNC(ifunc) ((ifunc)->func == bmcall)
60block_mark(
const struct rb_block *block)
62 switch (vm_block_type(block)) {
86 switch (block->
type) {
105proc_compact(
void *
ptr)
115 block_mark(&proc->
block);
125proc_memsize(
const void *
ptr)
164proc_clone(
VALUE self)
286binding_free(
void *
ptr)
294binding_mark(
void *
ptr)
299 block_mark(&bind->
block);
305binding_compact(
void *
ptr)
314binding_memsize(
const void *
ptr)
342binding_dup(
VALUE self)
356binding_clone(
VALUE self)
358 VALUE bindval = binding_dup(self);
387rb_f_binding(
VALUE self)
419get_local_variable_ptr(
const rb_env_t **envp,
ID lid)
466check_local_id(
VALUE bindval,
volatile VALUE *pname)
473 rb_name_err_raise(
"wrong local variable name `%1$s' for %2$s",
479 rb_name_err_raise(
"wrong local variable name `%1$s' for %2$s",
506bind_local_variables(
VALUE bindval)
512 env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->
block));
536 ID lid = check_local_id(bindval, &
sym);
545 env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->
block));
546 if ((
ptr = get_local_variable_ptr(&
env, lid)) !=
NULL) {
552 rb_name_err_raise(
"local variable `%1$s' is not defined for %2$s",
585 ID lid = check_local_id(bindval, &
sym);
593 env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->
block));
594 if ((
ptr = get_local_variable_ptr(&
env, lid)) ==
NULL) {
597 env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->
block));
625 ID lid = check_local_id(bindval, &
sym);
632 env = VM_ENV_ENVVAL_PTR(vm_block_ep(&bind->
block));
643bind_receiver(
VALUE bindval)
647 return vm_block_self(&bind->
block);
657bind_location(
VALUE bindval)
662 loc[0] = pathobj_path(bind->
pathobj);
676 proc = &sproc->
basic;
728 arity.argc.min = min_argc;
729 arity.argc.max = max_argc;
737 struct vm_ifunc *ifunc = rb_vm_ifunc_proc_new(
func, (
void *)val);
748static const char proc_without_block[] =
"tried to create Proc object without a block";
751proc_new(
VALUE klass, int8_t is_lambda, int8_t kernel)
763 switch (vm_block_handler_type(block_handler)) {
765 procval = VM_BH_TO_PROC(block_handler);
772 RBASIC_SET_CLASS(newprocval, klass);
779 sym_proc_new(klass, VM_BH_TO_SYMBOL(block_handler)) :
789 if (is_lambda && last_ruby_cfp && vm_cfp_forwarded_bh_p(last_ruby_cfp, block_handler)) {
857 switch (vm_block_handler_type(block_handler)) {
951#if SIZEOF_LONG > SIZEOF_INT
957 (
unsigned long)
argc);
962#define check_argc(argc) (argc)
995proc_to_block_handler(
VALUE procval)
1084rb_vm_block_min_max_arity(
const struct rb_block *block,
int *
max)
1087 switch (vm_block_type(block)) {
1091 block = vm_proc_block(block->
as.
proc);
1118rb_proc_min_max_arity(
VALUE self,
int *
max)
1122 return rb_vm_block_min_max_arity(&proc->
block,
max);
1131 min = rb_vm_block_min_max_arity(&proc->
block, &
max);
1138 switch (vm_block_handler_type(block_handler)) {
1141 block->
as.
captured = *VM_BH_TO_ISEQ_BLOCK(block_handler);
1145 block->
as.
captured = *VM_BH_TO_IFUNC_BLOCK(block_handler);
1149 block->
as.
symbol = VM_BH_TO_SYMBOL(block_handler);
1153 block->
as.
proc = VM_BH_TO_PROC(block_handler);
1170 block_setup(&block, block_handler);
1171 min = rb_vm_block_min_max_arity(&block, &
max);
1173 switch (vm_block_type(&block)) {
1179 VALUE procval = block_handler;
1182 if (
proc->is_lambda)
return 0;
1183 if (min !=
max)
return 0;
1205 block_setup(&block, block_handler);
1206 min = rb_vm_block_min_max_arity(&block, &
max);
1208 switch (vm_block_type(&block)) {
1214 VALUE procval = block_handler;
1237 block_setup(&block, block_handler);
1238 return rb_vm_block_min_max_arity(&block,
max);
1248 block = &
proc->block;
1249 if (is_proc) *is_proc = !
proc->is_lambda;
1251 switch (vm_block_type(block)) {
1261 if (is_proc) *is_proc = 0;
1305 const rb_proc_t *self_proc, *other_proc;
1306 const struct rb_block *self_block, *other_block;
1320 self_block = &self_proc->
block;
1321 other_block = &other_proc->
block;
1323 if (vm_block_type(self_block) != vm_block_type(other_block)) {
1327 switch (vm_block_type(self_block)) {
1364 if (!iseq)
return Qnil;
1365 rb_iseq_check(iseq);
1375 return iseq_location(iseq);
1396 int n = (arity < 0) ? ~arity : arity;
1422rb_proc_parameters(
VALUE self)
1446 enum {SYM_PROC_CACHE_SIZE = 67};
1451 if (!sym_proc_cache) {
1458 index = (
id % SYM_PROC_CACHE_SIZE) << 1;
1465 RARRAY_ASET(sym_proc_cache, index,
sym);
1466 RARRAY_ASET(sym_proc_cache, index + 1,
proc);
1481proc_hash(
VALUE self)
1497 switch (vm_block_type(block)) {
1499 block = vm_proc_block(block->
as.
proc);
1531proc_to_s(
VALUE self)
1547proc_to_proc(
VALUE self)
1563bm_compact(
void *
ptr)
1573bm_memsize(
const void *
ptr)
1575 return sizeof(
struct METHOD);
1606 if (obj ==
Qundef)
return 0;
1625 def->original_id =
id;
1639 if (!respond_to_missing_p(
klass, obj, vid, scope))
return Qfalse;
1640 return mnew_missing(
klass, obj,
SYM2ID(vid), mclass);
1653 if (respond_to_missing_p(
klass, obj,
ID2SYM(
id), scope)) {
1654 return mnew_missing(
klass, obj,
id, mclass);
1709 return mnew_from_me(
me,
klass,
iclass, obj,
id, mclass, scope);
1716 return defined_class ? defined_class :
me->
owner;
1761 VALUE klass1, klass2;
1772 klass1 = method_entry_defined_class(m1->
me);
1773 klass2 = method_entry_defined_class(m2->
me);
1795method_hash(
VALUE method)
1818method_unbind(
VALUE obj)
1821 struct METHOD *orig, *data;
1825 &method_data_type, data);
1844method_receiver(
VALUE obj)
1860method_name(
VALUE obj)
1882method_original_name(
VALUE obj)
1901method_owner(
VALUE obj)
1911#define MSG(s) rb_fstring_lit("undefined method `%1$s' for"s" `%2$s'")
1933 rb_name_err_raise_str(s, c,
str);
1945 VALUE m = mnew_missing_by_name(
klass, obj, &vid, scope, mclass);
1949 return mnew(
klass, obj,
id, mclass, scope);
1994 return obj_method(obj, vid,
FALSE);
2007 return obj_method(obj, vid,
TRUE);
2067 rb_name_err_raise(
"undefined singleton method `%1$s' for `%2$s'",
2179 int is_method =
FALSE;
2182 scope_visi = CREF_SCOPE_VISI(cref);
2202 "wrong argument type %s (expected Proc/Method/UnboundMethod)",
2214 "can't bind singleton method to a different class");
2218 "bind argument must be a subclass of % "PRIsVALUE,
2230 if (vm_proc_iseq(procval) !=
NULL) {
2299 rb_warning(
"main.define_method in the wrapped load is effective only in wrapper module");
2325method_clone(
VALUE self)
2328 struct METHOD *orig, *data;
2405method_callable_method_entry(
const struct METHOD *data)
2415 vm_passed_block_handler_set(ec, proc_to_block_handler(passed_procval));
2417 method_callable_method_entry(data), kw_splat);
2423 const struct METHOD *data;
2430 return call_method_data(ec, data,
argc,
argv, passed_procval, kw_splat);
2505 if (RB_TYPE_P(methclass,
T_MODULE)) {
2506 VALUE refined_class = rb_refinement_module_get_refined_class(methclass);
2507 if (!
NIL_P(refined_class)) methclass = refined_class;
2509 if (!RB_TYPE_P(methclass,
T_MODULE) &&
2513 "singleton method called for a different object");
2535 *methclass_out = methclass;
2581 convert_umethod_to_method_components(method,
recv, &methclass, &
klass, &
iclass, &
me);
2611 convert_umethod_to_method_components(method,
recv, &methclass, &
klass, &
iclass, &
me);
2631 if (!
def)
return *
max = 0;
2632 switch (
def->type) {
2634 if (
def->body.cfunc.argc < 0) {
2647 def =
def->body.alias.original_me->def;
2650 return rb_proc_min_max_arity(
def->body.bmethod.proc,
max);
2652 return rb_iseq_min_max_arity(rb_iseq_check(
def->body.iseq.iseqptr),
max);
2660 switch (
def->body.optimize_type) {
2679 rb_bug(
"rb_method_entry_min_max_arity: invalid method entry type (%d)",
def->type);
2686 int max, min = rb_method_entry_min_max_arity(
me, &
max);
2687 return min ==
max ? min : -min-1;
2734method_arity_m(
VALUE method)
2736 int n = method_arity(method);
2741method_arity(
VALUE method)
2758 id =
def->original_id;
2764method_min_max_arity(
VALUE method,
int *
max)
2766 const struct METHOD *data;
2769 return rb_method_entry_min_max_arity(data->
me,
max);
2790 VALUE binding = proc_binding(callable);
2794 return method_receiver(callable);
2804 const struct METHOD *data;
2807 return data->
me->
def;
2813 switch (
def->type) {
2815 return rb_iseq_check(
def->body.iseq.iseqptr);
2819 return method_def_iseq(
def->body.alias.original_me->def);
2841method_cref(
VALUE method)
2846 switch (
def->type) {
2848 return def->body.iseq.cref;
2850 def =
def->body.alias.original_me->def;
2861 if (!
def->body.attr.location)
2865 return iseq_location(method_def_iseq(
def));
2872 return method_def_location(
me->
def);
2909rb_method_parameters(
VALUE method)
2952method_inspect(
VALUE method)
2956 const char *sharp =
"#";
2958 VALUE defined_class;
2964 if (!mklass) mklass = data->
klass;
2978 defined_class = method_entry_defined_class(data->
me);
2981 if (RB_TYPE_P(defined_class,
T_ICLASS)) {
2991 else if (data->
recv == v) {
3004 mklass = data->
klass;
3010 }
while (RB_TYPE_P(mklass,
T_ICLASS));
3014 if (defined_class != mklass) {
3030 VALUE params = rb_method_parameters(method);
3044 for (
int i = 0; i <
RARRAY_LEN(params); i++) {
3051 if (kind == req || kind == opt) {
3054 else if (kind == rest || kind == keyrest) {
3057 else if (kind == block) {
3060 else if (kind == nokey) {
3068 else if (kind == opt) {
3071 else if (kind == keyreq) {
3074 else if (kind ==
key) {
3077 else if (kind == rest) {
3086 else if (kind == keyrest) {
3089 else if (kind == block) {
3102 else if (kind == nokey) {
3133mlambda(
VALUE method)
3161method_to_proc(
VALUE method)
3175 procval =
rb_iterate(mlambda, 0, bmcall, method);
3192method_super_method(
VALUE method)
3194 const struct METHOD *data;
3211 if (!super_class)
return Qnil;
3224localjump_xvalue(
VALUE exc)
3238localjump_reason(
VALUE exc)
3261 new_ep = &new_body[
env->ep -
env->env];
3262 new_env = vm_env_new(new_ep, new_body,
env->env_size,
env->iseq);
3282proc_binding(
VALUE self)
3292 block = &
proc->block;
3297 switch (vm_block_type(block)) {
3305 block = &
proc->block;
3314 binding_self = method_receiver(method);
3317 env = env_clone(
env, method_cref(method));
3338 rb_iseq_check(iseq);
3373 VALUE proc, passed, arity;
3382 if (!
NIL_P(blockarg)) {
3383 rb_warn(
"given block not used");
3385 arity = make_curry_proc(proc, passed, arity);
3438 int sarity, max_arity, min_arity = rb_proc_min_max_arity(self, &max_arity);
3451 return make_curry_proc(self,
rb_ary_new(), arity);
3489 VALUE proc = method_to_proc(self);
3490 return proc_curry(
argc,
argv, proc);
3543 return rb_proc_compose_to_left(self, to_callable(
g));
3549 VALUE proc, args, procs[2];
3602 return rb_proc_compose_to_right(self, to_callable(
g));
3608 VALUE proc, args, procs[2];
3646 self = method_to_proc(self);
3647 return proc_compose_to_left(self,
g);
3670 self = method_to_proc(self);
3671 return proc_compose_to_right(self,
g);
3707proc_ruby2_keywords(
VALUE procval)
3715 rb_warn(
"Skipping set of ruby2_keywords flag for proc (proc created from method)");
3727 rb_warn(
"Skipping set of ruby2_keywords flag for proc (proc accepts keywords or proc does not accept argument splat)");
3731 rb_warn(
"Skipping set of ruby2_keywords flag for proc (proc not defined in Ruby)");
4189 "define_method", top_define_method, -1);
void rb_ary_store(VALUE ary, long idx, VALUE val)
VALUE rb_ary_tmp_new_from_values(VALUE klass, long n, const VALUE *elts)
VALUE rb_ary_dup(VALUE ary)
VALUE rb_ary_push(VALUE ary, VALUE item)
VALUE rb_ary_freeze(VALUE ary)
VALUE rb_ary_tmp_new(long capa)
VALUE rb_ary_plus(VALUE x, VALUE y)
#define UNREACHABLE_RETURN
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
#define rb_define_singleton_method(klass, mid, func, arity)
Defines klass.mid.
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
#define rb_define_global_function(mid, func, arity)
Defines rb_mKernel #mid.
#define MJIT_FUNC_EXPORTED
char str[HTML_ESCAPE_MAX_LEN+1]
void rb_obj_call_init_kw(VALUE obj, int argc, const VALUE *argv, int kw_splat)
void rb_print_undef(VALUE klass, ID id, rb_method_visibility_t visi)
void rb_print_inaccessible(VALUE klass, ID id, rb_method_visibility_t visi)
VALUE rb_f_eval(int argc, const VALUE *argv, VALUE self)
#define RSTRING_LEN(string)
void ruby_xfree(void *x)
Deallocates a storage instance.
VALUE rb_gc_location(VALUE value)
void rb_gc_mark_movable(VALUE ptr)
void rb_gc_mark(VALUE ptr)
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
void rb_gc_register_mark_object(VALUE obj)
Inform the garbage collector that object is a live Ruby object that should not be moved.
#define RUBY_MARK_LEAVE(msg)
#define RUBY_MARK_ENTER(msg)
#define RUBY_MARK_MOVABLE_UNLESS_NULL(ptr)
#define RUBY_FREE_ENTER(msg)
#define RUBY_FREE_LEAVE(msg)
#define rb_intern_str(string)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
VALUE rb_singleton_class(VALUE obj)
Returns the singleton class of obj.
VALUE rb_include_class_new(VALUE module, VALUE super)
VALUE rb_singleton_class_get(VALUE obj)
Returns the singleton class of obj, or nil if obj is not a singleton object.
void rb_undef_method(VALUE klass, const char *name)
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
int rb_block_given_p(void)
Determines if the current method is given a block.
void rb_raise(VALUE exc, const char *fmt,...)
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
int rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
void rb_bug(const char *fmt,...)
void rb_warn_deprecated(const char *fmt, const char *suggest,...)
void rb_warn(const char *fmt,...)
VALUE rb_exc_new_str(VALUE etype, VALUE str)
void rb_warning(const char *fmt,...)
VALUE rb_mKernel
Kernel module.
VALUE rb_cObject
Object class.
VALUE rb_obj_class(VALUE)
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
VALUE rb_cModule
Module class.
VALUE rb_class_inherited_p(VALUE, VALUE)
Determines if mod inherits arg.
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
VALUE rb_class_search_ancestor(VALUE klass, VALUE super)
@ imemo_ifunc
iterator function
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
VALUE rb_funcall_with_block_kw(VALUE, ID, int, const VALUE *, VALUE, int)
#define UNLIMITED_ARGUMENTS
#define rb_hash_uint(h, i)
st_index_t rb_hash_start(st_index_t)
void rb_str_set_len(VALUE, long)
VALUE rb_str_append(VALUE, VALUE)
VALUE rb_str_buf_append(VALUE, VALUE)
VALUE rb_str_intern(VALUE)
#define rb_str_cat_cstr(buf, str)
VALUE rb_ivar_get(VALUE, ID)
int rb_obj_respond_to(VALUE, ID, int)
void rb_undef_alloc_func(VALUE)
ID rb_intern(const char *)
ID rb_check_id(volatile VALUE *)
Returns ID for the given name if it is interned already, or 0.
VALUE rb_iv_get(VALUE, const char *)
Internal header for Class.
Internal header for Object.
Internal header for Proc.
#define rb_fstring_lit(str)
int rb_is_local_name(VALUE name)
VALUE rb_vm_top_self(void)
#define rb_method_basic_definition_p(...)
VALUE rb_iseq_path(const rb_iseq_t *iseq)
VALUE rb_iseq_pathobj_new(VALUE path, VALUE realpath)
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc)
VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq)
rb_iseq_t * rb_iseq_new(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum iseq_type type)
#define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg)
rb_block_call_func * rb_block_call_func_t
VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
#define MEMCPY(p1, p2, type, n)
const rb_method_entry_t * rb_method_entry_clone(const rb_method_entry_t *me)
int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2)
const rb_method_entry_t * rb_method_entry(VALUE klass, ID id)
const rb_callable_method_entry_t * rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class)
void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi)
rb_method_entry_t * rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex)
#define UNDEFINED_REFINED_METHOD_P(def)
@ VM_METHOD_TYPE_ISEQ
Ruby method.
@ VM_METHOD_TYPE_ATTRSET
attr_writer or attr_accessor
@ VM_METHOD_TYPE_CFUNC
C method.
@ VM_METHOD_TYPE_OPTIMIZED
Kernel::send, Proc::call, etc.
@ VM_METHOD_TYPE_REFINED
refinement
@ VM_METHOD_TYPE_NOTIMPLEMENTED
@ VM_METHOD_TYPE_MISSING
wrapper for method_missing(id)
@ VM_METHOD_TYPE_IVAR
attr_reader or attr_accessor
@ OPTIMIZED_METHOD_TYPE_CALL
@ OPTIMIZED_METHOD_TYPE_BLOCK_CALL
@ OPTIMIZED_METHOD_TYPE_SEND
const rb_method_entry_t * rb_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class)
#define UNDEFINED_METHOD_ENTRY_P(me)
const rb_method_entry_t * rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class)
const rb_method_entry_t * rb_method_entry_at(VALUE obj, ID id)
const rb_callable_method_entry_t * rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, ID called_id, VALUE defined_class)
st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me)
rb_method_entry_t * rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def)
#define METHOD_ENTRY_VISI(me)
VALUE rb_iterate(onearg_type *q, VALUE w, type *e, VALUE r)
Old way to implement iterators.
VALUE rb_proc_call(VALUE self, VALUE args)
rb_cref_t * rb_vm_cref_new_toplevel(void)
int rb_method_entry_arity(const rb_method_entry_t *me)
const rb_method_definition_t * rb_method_def(VALUE method)
const rb_data_type_t ruby_binding_data_type
VALUE rb_obj_singleton_method(VALUE obj, VALUE vid)
VALUE rb_iseq_location(const rb_iseq_t *iseq)
const rb_cref_t * rb_vm_cref_in_context(VALUE self, VALUE cbase)
VALUE rb_binding_alloc(VALUE klass)
st_index_t rb_hash_proc(st_index_t hash, VALUE prc)
VALUE rb_proc_call_with_block_kw(VALUE self, int argc, const VALUE *argv, VALUE passed_procval, int kw_splat)
VALUE rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc)
VALUE rb_obj_is_method(VALUE m)
const rb_iseq_t * rb_proc_get_iseq(VALUE self, int *is_proc)
VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info)
int rb_proc_arity(VALUE self)
VALUE rb_block_proc(void)
VALUE rb_proc_call_kw(VALUE self, VALUE args, int kw_splat)
VALUE rb_proc_lambda_p(VALUE procval)
VALUE rb_callable_receiver(VALUE callable)
int rb_mod_method_arity(VALUE mod, ID id)
int rb_block_pair_yield_optimizable(void)
VALUE rb_unnamed_parameters(int arity)
VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val)
const rb_iseq_t * rb_method_iseq(VALUE method)
VALUE rb_find_defined_class_by_owner(VALUE current_class, VALUE target_owner)
#define IS_METHOD_PROC_IFUNC(ifunc)
VALUE rb_obj_method(VALUE obj, VALUE vid)
VALUE rb_method_call_kw(int argc, const VALUE *argv, VALUE method, int kw_splat)
struct vm_ifunc * rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc)
int rb_obj_method_arity(VALUE obj, ID id)
VALUE rb_proc_location(VALUE self)
#define UPDATE_REFERENCE(_ref)
VALUE rb_method_entry_location(const rb_method_entry_t *me)
VALUE rb_method_location(VALUE method)
VALUE rb_block_lambda(void)
VALUE rb_method_call(int argc, const VALUE *argv, VALUE method)
void rb_method_name_error(VALUE klass, VALUE str)
VALUE rb_sym_to_proc(VALUE sym)
VALUE rb_proc_new(rb_block_call_func_t func, VALUE val)
VALUE rb_binding_new(void)
VALUE rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE passed_procval)
VALUE rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE passed_procval)
VALUE rb_obj_public_method(VALUE obj, VALUE vid)
VALUE rb_method_call_with_block_kw(int argc, const VALUE *argv, VALUE method, VALUE passed_procval, int kw_splat)
int rb_block_min_max_arity(int *max)
#define UPDATE_TYPED_REFERENCE(_type, _ref)
VALUE rb_obj_is_proc(VALUE proc)
VALUE rb_proc_alloc(VALUE klass)
#define RARRAY_CONST_PTR(s)
#define RARRAY_AREF(a, i)
#define RB_OBJ_WRITE(a, slot, b)
WB for new reference from ‘a’ to ‘b’.
#define RB_OBJ_WRITTEN(a, oldv, b)
WB for new reference from ‘a’ to ‘b’.
VALUE rb_mRubyVMFrozenCore
#define RUBY_TYPED_DEFAULT_FREE
#define TypedData_Get_Struct(obj, type, data_type, sval)
@ RUBY_TYPED_FREE_IMMEDIATELY
@ RUBY_TYPED_WB_PROTECTED
#define TypedData_Make_Struct(klass, type, data_type, sval)
#define Check_TypedStruct(v, t)
const char * rb_obj_classname(VALUE)
#define RB_PASS_CALLED_KEYWORDS
VALUE rb_str_catf(VALUE, const char *,...)
VALUE rb_sprintf(const char *,...)
const rb_method_entry_t *const me
VALUE env[VM_ENV_DATA_SIZE+1]
unsigned short first_lineno
const struct rb_block block
struct rb_captured_block captured
const struct vm_ifunc * ifunc
union rb_captured_block::@198 code
unsigned int ruby2_keywords
const struct rb_iseq_constant_body::@188::rb_iseq_param_keyword * keyword
struct rb_iseq_struct * local_iseq
unsigned int local_table_size
struct rb_iseq_constant_body::@188::@190 flags
rb_iseq_location_t location
struct rb_iseq_constant_body::@188 param
parameter information
struct rb_iseq_constant_body * body
struct rb_method_entry_struct * original_me
union rb_method_definition_struct::@123 body
struct rb_method_definition_struct *const def
const struct rb_block block
unsigned int is_from_method
IFUNC (Internal FUNCtion)
struct vm_ifunc_argc argc
rb_block_call_func_t func
void error(const char *msg)
void rb_vm_block_copy(VALUE obj, const struct rb_block *dst, const struct rb_block *src)
VALUE rb_vm_frame_block_handler(const rb_control_frame_t *cfp)
VALUE rb_proc_dup(VALUE self)
VALUE rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *src_cfp)
VALUE rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda)
VALUE rb_vm_env_local_variables(const rb_env_t *env)
rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
VALUE rb_vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, int argc, const VALUE *argv, int kw_splat, VALUE passed_block_handler)
const VALUE * rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars)
const rb_env_t * rb_vm_env_prev_env(const rb_env_t *env)
void rb_vm_block_ep_update(VALUE obj, const struct rb_block *dst, const VALUE *ep)
#define rb_vm_register_special_exception(sp, e, m)
#define GetBindingPtr(obj, ptr)
#define VM_ENV_DATA_INDEX_FLAGS
@ block_handler_type_ifunc
@ block_handler_type_proc
@ block_handler_type_symbol
@ block_handler_type_iseq
#define VM_ENV_DATA_INDEX_ENV
#define VM_BLOCK_HANDLER_NONE
#define VM_ENV_DATA_INDEX_SPECVAL
#define GetProcPtr(obj, ptr)
#define VM_ENV_DATA_INDEX_ME_CREF
VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler)
#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)
#define VM_UNREACHABLE(func)
VALUE rb_vm_call_kw(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat)
@ VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM
int def(FILE *source, FILE *dest, int level)
#define ZALLOC(strm, items, size)