27 static VALUE rb_eUncaughtThrow;
28 static ID id_result, id_tag, id_value;
29 #define id_mesg idMesg 49 calling = &calling_entry;
59 return vm_call0_body(th, calling, &ci_entry, &cc_entry, argv);
80 block_handler, (
VALUE)me,
81 0, reg_cfp->
sp, 0, 0);
86 val = (*cfunc->
invoker)(cfunc->
func, recv, argc, argv);
101 return vm_call0_cfunc_with_frame(th, calling, ci, cc, argv);
113 switch (cc->
me->
def->type) {
121 *reg_cfp->
sp++ = calling->
recv;
122 for (i = 0; i < calling->
argc; i++) {
123 *reg_cfp->
sp++ = argv[i];
126 vm_call_iseq_setup(th, reg_cfp, calling, ci, cc);
132 ret = vm_call0_cfunc(th, calling, ci, cc, argv);
143 ret = vm_call_bmethod_body(th, calling, ci, cc, argv);
154 else if (cc->
me->
def->body.refined.orig_me) {
155 cc->
me = refined_method_callable_without_refinement(cc->
me);
163 ret = method_missing(calling->
recv, ci->
mid, calling->
argc, argv, ex);
170 cc->
me = aliased_callable_method_entry(cc->
me);
175 return method_missing(calling->
recv, ci->
mid, calling->
argc,
179 switch (cc->
me->
def->body.optimize_type) {
191 rb_bug(
"vm_call0: unsupported optimized method type (%d)", cc->
me->
def->body.optimize_type);
197 rb_bug(
"vm_call0: unsupported method type (%d)", cc->
me->
def->type);
208 return vm_call0(th, recv,
id, argc, argv, me);
220 if (VM_FRAME_RUBYFRAME_P(cfp)) {
221 rb_bug(
"vm_call_super: should not be reached");
226 id = me->
def->original_id;
233 return vm_call0(th, recv,
id, argc, argv, me);
242 return vm_call_super(th, argc, argv);
250 if (!th || !(cfp = th->
ec.
cfp))
284 rb_call0(
VALUE recv,
ID mid,
int argc,
const VALUE *argv,
292 return method_missing(recv, mid, argc, argv, call_status);
295 return vm_call0(th, recv, mid, argc, argv, me);
314 args->
recv, idMethodMissing,
345 return vm_respond_to(th, klass, recv, mid,
TRUE);
361 ret = basic_obj_respond_to_missing(th, klass, recv,
363 if (!
RTEST(ret))
return def;
367 me = method_entry_get(klass, idMethodMissing, &args.
defined_class);
371 new_args[0] =
ID2SYM(mid);
378 args.
argc = argc + 1;
381 check_funcall_failed, (
VALUE)&args,
400 int respond = check_funcall_respond_to(th, klass, recv, mid);
405 me = rb_search_method_entry(recv, mid);
406 if (!check_funcall_callable(th, me)) {
407 VALUE ret = check_funcall_missing(th, klass, recv, mid, argc, argv,
409 if (ret ==
Qundef) ret = def;
413 return vm_call0(th, recv, mid, argc, argv, me);
423 int respond = check_funcall_respond_to(th, klass, recv, mid);
430 me = rb_search_method_entry(recv, mid);
431 if (!check_funcall_callable(th, me)) {
432 VALUE ret = check_funcall_missing(th, klass, recv, mid, argc, argv,
439 return vm_call0(th, recv, mid, argc, argv, me);
445 #define type_case(t) case t: return #t; 473 default:
return NULL;
479 rb_search_method_entry(
VALUE recv,
ID mid)
487 "method `%"PRIsVALUE"' called on unexpected immediate object (%p)",
490 flags =
RBASIC(recv)->flags;
493 "method `%"PRIsVALUE"' called on terminated object" 499 const char *typestr = rb_type_str(type);
502 "method `%"PRIsVALUE"' called on hidden %s object" 504 rb_id2str(mid), typestr, (
void *)recv, flags);
507 "method `%"PRIsVALUE"' called on unexpected %s object" 508 " (%p flags=0x%"PRIxVALUE
")",
509 rb_id2str(mid), typestr, (
void *)recv, flags);
512 "method `%"PRIsVALUE"' called on broken T_???" "(0x%02x) object" 513 " (%p flags=0x%"PRIxVALUE
")",
514 rb_id2str(mid), type, (
void *)recv, flags);
537 oid = me->
def->original_id;
540 if (oid != idMethodMissing) {
552 defined_class =
RBASIC(defined_class)->klass;
581 return rb_call0(recv, mid, argc, argv, scope, th->
ec.
cfp->
self);
621 rb_method_missing(
int argc,
const VALUE *argv,
VALUE obj)
630 int argc,
const VALUE *argv,
int priv)
640 VALUE args[args_size];
679 format =
rb_fstring_cstr(
"undefined local variable or method `%s' for %s%s%s");
683 format =
rb_fstring_cstr(
"super: no superclass method `%s' for %s%s%s");
687 exc = make_no_method_exception(exc, format, obj, argc, argv,
699 VALUE *nargv, result, work, klass;
701 VALUE block_handler = vm_passed_block_handler(th);
706 if (
id == idMethodMissing) {
708 raise_method_missing(th, argc, argv, obj, call_status |
MISSING_MISSING);
718 if (!klass)
goto missing;
721 vm_passed_block_handler_set(th, block_handler);
722 result = vm_call0(th, obj, idMethodMissing, argc, argv, me);
729 VALUE obj,
int call_status)
732 raise_method_missing(th, argc, argv, obj, call_status |
MISSING_MISSING);
760 return rb_call(recv, mid, argc, argv,
CALL_FCALL);
786 for (i = 0; i < n; i++) {
787 argv[i] = va_arg(ar,
VALUE);
794 return rb_call(recv, mid, n, argv,
CALL_FCALL);
807 return rb_call(recv, mid, argc, argv,
CALL_FCALL);
822 return rb_call(recv, mid, argc, argv,
CALL_PUBLIC);
829 return rb_call(recv, mid, argc, argv,
CALL_PUBLIC);
835 if (!
NIL_P(passed_procval)) {
837 vm_passed_block_handler_set(th, passed_procval);
840 return rb_call(recv, mid, argc, argv,
CALL_PUBLIC);
848 if (prev_cfp->
sp + 1 != argv)
return NULL;
849 return prev_cfp->
sp + 1;
858 VALUE ret, vargv = 0;
883 VALUE *tmp_argv = current_vm_stack_arg(th, argv);
898 id = idMethodMissing;
905 ret = rb_call0(recv,
id, argc, argv, scope,
self);
935 return send_internal(argc, argv, recv,
CALL_FCALL);
955 return send_internal(argc, argv, recv,
CALL_PUBLIC);
961 rb_yield_0(
int argc,
const VALUE * argv)
969 return rb_yield_0(1, &val);
976 return rb_yield_0(0, 0);
983 #undef rb_yield_values 988 return rb_yield_0(0, 0);
997 for (i=0; i<n; i++) {
998 argv[i] = va_arg(args,
VALUE);
1002 return rb_yield_0(n, argv);
1009 return rb_yield_0(argc, argv);
1028 return vm_yield_force_blockarg(
GET_THREAD(), values);
1034 return vm_yield_with_block(
GET_THREAD(), argc, argv,
1090 rb_f_loop(
VALUE self)
1103 const struct vm_ifunc *
const ifunc,
1115 VALUE block_handler;
1120 block_handler = VM_BH_FROM_IFUNC_BLOCK(captured);
1123 block_handler = VM_CF_BLOCK_HANDLER(cfp);
1125 vm_passed_block_handler_set(th, block_handler);
1127 retval = (*it_proc) (data1);
1133 if (cfp == escape_cfp) {
1140 if (state ==
TAG_RETRY)
goto iter_retry;
1141 retval = THROW_DATA_VAL(err);
1144 SDR(); fprintf(stderr,
"%p, %p\n", cfp, escape_cfp);
1159 return rb_iterate0(it_proc, data1,
1160 bl_proc ? rb_vm_ifunc_proc_new(bl_proc, (
void *)data2) : 0,
1172 iterate_method(
VALUE obj)
1211 iterate_check_method(
VALUE obj)
1235 return rb_call(obj, idEach, 0, 0,
CALL_FCALL);
1257 VALUE filename,
int lineno)
1264 volatile VALUE file;
1281 if (!
NIL_P(scope)) {
1284 if (
NIL_P(realpath)) {
1285 file = pathobj_path(bind->
pathobj);
1286 realpath = pathobj_realpath(bind->
pathobj);
1289 base_block = &bind->
block;
1295 block.
as.
captured = *VM_CFP_TO_CAPTURED_BLOCK(cfp);
1299 base_block = █
1306 if ((fname = file) ==
Qundef) {
1320 rb_cref_t *orig_cref = rb_vm_get_cref(vm_block_ep(base_block));
1321 cref = vm_cref_dup(orig_cref);
1327 vm_set_eval_stack(th, iseq, cref, base_block);
1336 vm_bind_update_env(scope, bind, vm_make_env_object(th, th->
ec.
cfp));
1347 result = vm_exec(th);
1353 adjust_backtrace_in_eval(th, th->
ec.
errinfo);
1363 return eval_string_with_cref(
self, src, scope, 0, file, line);
1387 VALUE src, scope, vfile, vline;
1391 rb_scan_args(argc, argv,
"13", &src, &scope, &vfile, &vline);
1402 return eval_string(
self, src, scope, file, line);
1419 eval_string_from_file_helper(
VALUE data)
1543 VALUE block_handler = VM_CF_BLOCK_HANDLER(cfp);
1544 VALUE new_block_handler = 0;
1549 int is_lambda =
FALSE;
1553 switch (vm_block_handler_type(block_handler)) {
1555 captured = VM_BH_TO_CAPT_BLOCK(block_handler);
1556 new_captured = *captured;
1557 new_block_handler = VM_BH_FROM_ISEQ_BLOCK(&new_captured);
1560 captured = VM_BH_TO_CAPT_BLOCK(block_handler);
1561 new_captured = *captured;
1562 new_block_handler = VM_BH_FROM_IFUNC_BLOCK(&new_captured);
1566 block_handler = vm_proc_to_block_handler(VM_BH_TO_PROC(block_handler));
1573 new_captured.
self =
self;
1579 cref = vm_cref_push(th, under, ep,
TRUE);
1580 return vm_yield_with_cref(th, argc, argv, cref, is_lambda);
1587 VALUE block_handler = VM_CF_BLOCK_HANDLER(th->
ec.
cfp);
1590 rb_bug(
"rb_yield_refine_block: an iseq block is required");
1595 VALUE new_block_handler = VM_BH_FROM_ISEQ_BLOCK(&new_captured);
1598 CREF_REFINEMENTS_SET(cref, refinements);
1600 new_captured.
self = refinement;
1601 return vm_yield_with_cref(th, 0,
NULL, cref,
FALSE);
1611 return eval_string_with_cref(
self, src,
Qnil, cref, file, line);
1619 return yield_under(klass,
self, 1, &
self);
1635 return eval_under(klass,
self, code, file, line);
1640 singleton_class_for_eval(
VALUE self)
1691 VALUE klass = singleton_class_for_eval(
self);
1692 return specific_eval(argc, argv, klass,
self);
1716 VALUE klass = singleton_class_for_eval(
self);
1717 return yield_under(klass,
self, argc, argv);
1750 return specific_eval(argc, argv, mod, mod);
1778 return yield_under(mod, mod, argc, argv);
1795 uncaught_throw_init(
int argc,
const VALUE *argv,
VALUE exc)
1812 uncaught_throw_tag(
VALUE exc)
1825 uncaught_throw_value(
VALUE exc)
1838 uncaught_throw_to_s(
VALUE exc)
1841 VALUE tag = uncaught_throw_tag(exc);
1858 rb_f_throw(
int argc,
VALUE *argv)
1874 if (tt->
tag == tag) {
1901 return rb_yield_0(1, &tag);
1956 rb_f_catch(
int argc,
VALUE *argv)
1990 val = (*func)(
tag, data, 1, (
const VALUE *)&tag,
Qnil);
2008 return vm_catch_protect(t, func, data, stateptr,
GET_THREAD());
2072 rb_f_local_variables(
void)
2080 local_var_list_init(&vars);
2087 if (!VM_ENV_LOCAL_P(cfp->
ep)) {
2089 const VALUE *ep = VM_CF_PREV_EP(cfp);
2091 if (vm_collect_local_variables_in_heap(th, ep, &vars)) {
2095 while (cfp->
ep != ep) {
2104 return local_var_list_finish(&vars);
2188 rb_define_method(rb_eUncaughtThrow,
"initialize", uncaught_throw_init, -1);
VALUE rb_f_public_send(int argc, VALUE *argv, VALUE recv)
#define RBASIC_CLEAR_CLASS(obj)
rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp)
wrapper for method_missing(id)
#define UNDEFINED_METHOD_ENTRY_P(me)
ID rb_check_id(volatile VALUE *)
Returns ID for the given name if it is interned already, or 0.
#define RUBY_VM_CHECK_INTS(th)
VALUE rb_protect(VALUE(*proc)(VALUE), VALUE data, int *pstate)
Protects a function call from potential global escapes from the function.
void rb_bug(const char *fmt,...)
#define RUBY_EVENT_C_RETURN
VALUE(* rb_block_call_func_t)(ANYARGS)
#define va_init_list(a, b)
rb_iseq_t * rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, const struct rb_block *base_block, VALUE opt)
VALUE rb_current_realfilepath(void)
VALUE rb_yield_values(int n,...)
const rb_callable_method_entry_t * me
VALUE rb_obj_instance_exec(int argc, const VALUE *argv, VALUE self)
#define VAR_NOCLOBBERED(var)
void rb_throw(const char *tag, VALUE val)
#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)
#define GetProcPtr(obj, ptr)
int rb_block_given_p(void)
Determines if the current method is given a block.
VALUE rb_yield_splat(VALUE values)
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv, rb_check_funcall_hook *hook, VALUE arg)
VALUE rb_ary_subseq(VALUE ary, long beg, long len)
VALUE rb_fstring_cstr(const char *str)
void rb_raise(VALUE exc, const char *fmt,...)
VALUE rb_call_super(int argc, const VALUE *argv)
struct vm_ifunc * rb_vm_ifunc_new(VALUE(*func)(ANYARGS), const void *data, int min_argc, int max_argc)
enum method_missing_reason method_missing_reason
VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
struct rb_method_definition_struct *const def
#define CHECK_CFP_CONSISTENCY(func)
const rb_callable_method_entry_t * rb_vm_frame_method_entry(const rb_control_frame_t *cfp)
#define new_args(f, o, r, p, t)
VALUE rb_mod_module_eval(int argc, const VALUE *argv, VALUE mod)
void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
#define TH_JUMP_TAG(th, st)
VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, int argc, const VALUE *argv, VALUE passed_block_handler)
#define VM_BLOCK_HANDLER_NONE
VALUE rb_check_funcall_default(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE def)
VALUE rb_eval_string_protect(const char *str, int *pstate)
Evaluates the given string in an isolated binding.
struct rb_iseq_constant_body * body
VALUE rb_ivar_get(VALUE, ID)
VALUE rb_check_funcall(VALUE recv, ID mid, int argc, const VALUE *argv)
VALUE rb_obj_alloc(VALUE)
Allocates an instance of klass.
#define FL_TEST_RAW(x, f)
VALUE rb_catch(const char *tag, VALUE(*func)(), VALUE data)
#define RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th, cfp)
int st_update(st_table *table, st_data_t key, st_update_callback_func *func, st_data_t arg)
VALUE rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method)
void rb_define_global_function(const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a global function.
VALUE rb_threadptr_backtrace_str_ary(rb_thread_t *th, long lev, long n)
VALUE ruby_eval_string_from_file(const char *str, const char *filename)
VALUE rb_rescue2(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*r_proc)(ANYARGS), VALUE data2,...)
An equivalent of rescue clause.
VALUE rb_catch_obj(VALUE t, VALUE(*func)(), VALUE data)
#define RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, klass, id)
VALUE rb_obj_instance_eval(int argc, const VALUE *argv, VALUE self)
VALUE rb_hash_keys(VALUE hash)
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
VALUE rb_singleton_class(VALUE obj)
Returns the singleton class of obj.
VALUE rb_obj_class(VALUE)
call-seq: obj.class -> class
#define RB_TYPE_P(obj, type)
VALUE rb_obj_is_kind_of(VALUE, VALUE)
call-seq: obj.is_a?(class) -> true or false obj.kind_of?(class) -> true or false
VALUE rb_check_block_call(VALUE obj, ID mid, int argc, const VALUE *argv, VALUE(*bl_proc)(ANYARGS), VALUE data2)
VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr)
VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg))
unsigned short first_lineno
#define RUBY_SAFE_LEVEL_MAX
unsigned int local_table_size
#define PASS_PASSED_BLOCK_HANDLER_TH(th)
RUBY_EXTERN VALUE rb_cObject
VALUE rb_special_singleton_class(VALUE obj)
RUBY_EXTERN VALUE rb_cBasicObject
VALUE rb_funcall(VALUE recv, ID mid, int n,...)
Calls a method.
VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, VALUE passed_proc)
RUBY_EXTERN VALUE rb_mKernel
VALUE rb_funcall_with_block(VALUE recv, ID mid, int argc, const VALUE *argv, VALUE passed_procval)
void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
VALUE rb_f_eval(int argc, const VALUE *argv, VALUE self)
const rb_data_type_t ruby_binding_data_type
#define ALLOCV_N(type, v, n)
#define ALLOCA_N(type, n)
const VALUE defined_class
#define RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, klass, id)
union rb_captured_block::@141 code
RUBY_EXTERN VALUE rb_cModule
#define MEMCPY(p1, p2, type, n)
#define RUBY_EVENT_C_CALL
void rb_throw_obj(VALUE tag, VALUE value)
const rb_callable_method_entry_t * rb_resolve_refined_method_callable(VALUE refinements, const rb_callable_method_entry_t *me)
VALUE rb_funcallv(VALUE recv, ID mid, int argc, const VALUE *argv)
Calls a method.
#define VM_ENV_DATA_INDEX_SPECVAL
void rb_threadptr_stack_overflow(rb_thread_t *th, int crit)
VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t bl_proc, int min_argc, int max_argc, VALUE data2)
attr_writer or attr_accessor
void rb_vm_pop_frame(rb_thread_t *th)
#define RARRAY_CONST_PTR(a)
VALUE(* invoker)(VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *argv)
VALUE rb_str_format(int, const VALUE *, VALUE)
const rb_callable_method_entry_t * rb_callable_method_entry(VALUE klass, ID id)
NORETURN(static void raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj, enum method_missing_reason call_status))
void rb_raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj, int call_status)
VALUE rb_eval_string(const char *str)
Evaluates the given string in an isolated binding.
VALUE rb_iterate(VALUE(*it_proc)(VALUE), VALUE data1, VALUE(*bl_proc)(ANYARGS), VALUE data2)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
#define rb_thread_raised_set(th, f)
VALUE rb_ivar_set(VALUE, ID, VALUE)
VALUE rb_f_send(int argc, VALUE *argv, VALUE recv)
void rb_vm_pop_cfunc_frame(void)
void rb_exc_raise(VALUE mesg)
Raises an exception in the current thread.
IFUNC (Internal FUNCtion)
#define METHOD_ENTRY_VISI(me)
VALUE rb_vm_top_self(void)
#define EXEC_EVENT_HOOK(th_, flag_, self_, id_, called_id_, klass_, data_)
VALUE rb_hash_clear(VALUE hash)
#define RETURN_SIZED_ENUMERATOR(obj, argc, argv, size_fn)
const struct vm_ifunc * ifunc
VALUE rb_str_new_cstr(const char *)
VALUE rb_proc_lambda_p(VALUE)
#define RARRAY_LENINT(ary)
const rb_method_entry_t * me
Kernel::send, Proc::call, etc.
VALUE rb_sym_intern_ascii_cstr(const char *ptr)
struct rb_captured_block captured
VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements)
register unsigned int len
void rb_set_safe_level_force(int)
VALUE rb_mod_module_exec(int argc, const VALUE *argv, VALUE mod)
VALUE rb_iseq_realpath(const rb_iseq_t *iseq)
#define RARRAY_ASET(a, i, v)
VALUE rb_iseq_disasm(const rb_iseq_t *iseq)
VALUE rb_get_backtrace(VALUE exc)
#define UNLIMITED_ARGUMENTS
VALUE rb_module_new(void)
#define RARRAY_AREF(a, i)
#define METHOD_ENTRY_BASIC(me)
VALUE rb_eval_string_wrap(const char *str, int *pstate)
Evaluates the given string under a module binding in an isolated binding.
unsigned int respond_to_missing
VALUE rb_check_array_type(VALUE ary)
void rb_extend_object(VALUE obj, VALUE module)
Extend the object with the module.
VALUE ruby_eval_string_from_file_protect(const char *str, const char *filename, int *state)
rb_method_entry_t * rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi)
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
int rb_method_basic_definition_p(VALUE, ID)
VALUE rb_apply(VALUE recv, ID mid, VALUE args)
Calls a method.
VALUE rb_yield_values2(int argc, const VALUE *argv)
VALUE rb_funcall_passing_block(VALUE recv, ID mid, int argc, const VALUE *argv)
int rb_is_local_id(ID id)
#define rb_thread_raised_p(th, f)
#define SafeStringValue(v)
VALUE rb_funcallv_public(VALUE recv, ID mid, int argc, const VALUE *argv)
Calls a method.
VALUE rb_f_block_given_p(void)
rb_execution_context_t ec
VALUE rb_yield(VALUE val)
#define StringValuePtr(v)
VALUE rb_source_location(int *pline)
void rb_vm_rewind_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
VALUE rb_str_intern(VALUE)
#define rb_intern_const(str)
#define SPECIAL_CONST_P(x)
int rb_threadptr_stack_check(rb_thread_t *th)
#define CHECK_VM_STACK_OVERFLOW(cfp, margin)
int rb_method_boundp(VALUE, ID, int)
VALUE rb_yield_1(VALUE val)
VALUE rb_eval_cmd(VALUE cmd, VALUE arg, int level)
const struct rb_block block
attr_reader or attr_accessor
VALUE rb_block_call(VALUE obj, ID mid, int argc, const VALUE *argv, VALUE(*bl_proc)(ANYARGS), VALUE data2)
VALUE rb_obj_clone(VALUE)
:nodoc Almost same as Object::clone ++
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
VALUE rb_yield_block(VALUE val, VALUE arg, int argc, const VALUE *argv, VALUE blockarg)
#define Check_TypedStruct(v, t)
VALUE rb_attr_get(VALUE, ID)
VALUE rb_usascii_str_new_cstr(const char *)
VALUE rb_yield_force_blockarg(VALUE values)
#define PASS_PASSED_BLOCK_HANDLER()
VALUE rb_current_receiver(void)