22 #define numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
29 #define exception_error GET_VM()->special_exceptions[ruby_error_reenter]
39 static int initialized = 0;
68 void *
volatile iseq = 0;
115 volatile VALUE errs[2];
154 #if EXIT_SUCCESS != 0 || EXIT_FAILURE != 1
156 #if EXIT_SUCCESS != 0
159 #if EXIT_FAILURE != 1
166 for (nerr = 0; nerr <
numberof(errs); ++nerr) {
169 if (!
RTEST(err))
continue;
232 if (status) *status = s;
275 while (cref && cref->nd_next) {
276 VALUE klass = cref->nd_clss;
281 cref = cref->nd_next;
321 klass = cref->nd_clss;
329 cref = cref->nd_next;
341 const char *desc =
"something(?!)";
347 switch (
TYPE(klass)) {
369 volatile int line = 0;
381 if (file && !
NIL_P(mesg)) {
608 if ((th->
cfp->
lfp[0] & 0x02) == 0 &&
647 result = (*b_proc) (data1);
657 while ((eclass = va_arg(args,
VALUE)) != 0) {
669 result = (*r_proc) (data2, th->
errinfo);
744 result = (*b_proc) (data1);
762 while (cfp_limit > cfp) {
763 if (cfp->
iseq == iseq)
781 if (ifunc->nd_aid)
return ifunc->nd_aid;
846 switch (
TYPE(include)) {
871 for (i = 0; i <
argc; i++)
960 for (i = 0; i <
argc; i++)
986 (
"main#include in the wrapped load is effective only in wrapper module");
1000 if (cfp->
iseq->
type == ISEQ_TYPE_RESCUE) {
1001 return &cfp->
dfp[-2];
1003 else if (cfp->
iseq->
type == ISEQ_TYPE_ENSURE &&
1006 return &cfp->
dfp[-2];
static void ruby_finalize_0(void)
void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th)
VALUE rb_exc_new(VALUE etype, const char *ptr, long len)
void rb_raise_jump(VALUE mesg)
static const rb_method_entry_t * method_entry_of_iseq(rb_control_frame_t *cfp, rb_iseq_t *iseq)
#define RUBY_EVENT_C_RETURN
static VALUE rb_f_raise(int argc, VALUE *argv)
struct rb_vm_protect_tag * protect_tag
#define RUBY_VM_IFUNC_P(ptr)
VALUE rb_make_exception(int argc, VALUE *argv)
#define INTERNAL_EXCEPTION_P(exc)
void rb_define_virtual_variable(const char *, VALUE(*)(ANYARGS), void(*)(ANYARGS))
void ruby_prog_init(void)
void rb_define_singleton_method(VALUE obj, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a singleton method for obj.
int ruby_cleanup(volatile int ex)
#define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp)
#define RUBY_VM_NORMAL_ISEQ_P(ptr)
void rb_error_frozen(const char *what)
void rb_exec_end_proc(void)
static void set_backtrace(VALUE info, VALUE bt)
void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
ID rb_frame_this_func(void)
static int sysexit_status(VALUE err)
static VALUE rb_mod_include(int argc, VALUE *argv, VALUE module)
static ID frame_func_id(rb_control_frame_t *cfp)
VALUE rb_ary_push(VALUE ary, VALUE item)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
#define STACK_UPPER(x, a, b)
VALUE rb_protect(VALUE(*proc)(VALUE), VALUE data, int *state)
#define RSTRING_PTR(string)
struct rb_iseq_struct * local_iseq
void rb_raise(VALUE exc, const char *fmt,...)
struct rb_vm_protect_tag * prev
VALUE rb_obj_is_kind_of(VALUE, VALUE)
int ruby_exec_node(void *n)
VALUE rb_ary_new3(long n,...)
void rb_vm_localjump_error(const char *mesg, VALUE value, int reason)
void rb_include_module(VALUE klass, VALUE module)
static VALUE errinfo_getter(ID id)
static VALUE rb_obj_extend(int argc, VALUE *argv, VALUE obj)
void rb_define_global_function(const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a global function.
void rb_undef_method(VALUE klass, const char *name)
VALUE rb_rubylevel_errinfo(void)
VALUE rb_iseq_eval_main(VALUE iseqval)
const rb_method_entry_t * me
void rb_thread_terminate_all(void)
const char * rb_obj_classname(VALUE)
VALUE rb_enc_sprintf(rb_encoding *enc, const char *format,...)
int ruby_run_node(void *n)
void rb_exc_raise(VALUE mesg)
NORETURN(void rb_raise_jump(VALUE))
VALUE rb_singleton_class(VALUE obj)
Returns the singleton class of obj.
enum rb_iseq_struct::iseq_type type
static VALUE rb_f_method_name(void)
#define RUBY_VM_CHECK_INTS()
VALUE rb_rescue(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*r_proc)(ANYARGS), VALUE data2)
static VALUE get_backtrace(VALUE info)
static int error_handle(int ex)
int rb_block_given_p(void)
void * rb_mod_const_at(VALUE, void *)
int rb_threadptr_set_raised(rb_thread_t *th)
RUBY_EXTERN VALUE rb_cObject
VALUE rb_obj_as_string(VALUE)
RUBY_EXTERN VALUE rb_mKernel
VALUE rb_iv_get(VALUE, const char *)
void rb_thread_stop_timer_thread(int close_anyway)
#define PASS_PASSED_BLOCK()
static VALUE rb_mod_extend_object(VALUE mod, VALUE obj)
void rb_threadptr_check_signal(rb_thread_t *mth)
RUBY_EXTERN VALUE rb_cModule
int ruby_executable_node(void *n, int *status)
#define MEMCPY(p1, p2, type, n)
VALUE rb_mod_constants(int, VALUE *, VALUE)
VALUE rb_make_backtrace(void)
#define rb_thread_raised_clear(th)
VALUE rb_check_funcall(VALUE, ID, int, VALUE *)
static VALUE rb_mod_nesting(void)
VALUE rb_funcall2(VALUE, ID, int, const VALUE *)
Calls a method.
#define RB_GC_GUARD(object)
VALUE rb_iv_set(VALUE, const char *, VALUE)
static void ruby_finalize_1(void)
void * rb_mod_const_of(VALUE, void *)
struct rb_iseq_struct * parent_iseq
rb_encoding * rb_usascii_encoding(void)
static ID rb_frame_caller(void)
VALUE rb_const_list(void *)
#define SAVE_ROOT_JMPBUF(th, stmt)
int ruby_vm_destruct(ruby_vm_t *vm)
static void setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg)
void rb_extend_object(VALUE obj, VALUE module)
int rb_threadptr_reset_raised(rb_thread_t *th)
VALUE rb_rescue2(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*r_proc)(ANYARGS), VALUE data2,...)
VALUE rb_ensure(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*e_proc)(ANYARGS), VALUE data2)
static VALUE get_errinfo(void)
RUBY_EXTERN VALUE rb_cClass
void rb_jump_tag(int tag)
#define RUBY_VM_END_CONTROL_FRAME(th)
static int ruby_exec_internal(void *n)
#define va_init_list(a, b)
static void warn_printf(const char *fmt,...)
#define EXEC_EVENT_HOOK(th, flag, self, id, klass)
static VALUE top_include(int argc, VALUE *argv, VALUE self)
void * ruby_process_options(int, char **)
VALUE rb_exc_new3(VALUE etype, VALUE str)
rb_method_definition_t * def
void rb_set_errinfo(VALUE err)
void ruby_sig_finalize(void)
static VALUE * errinfo_place(rb_thread_t *th)
VALUE rb_check_string_type(VALUE)
void rb_trap_restore_mask(void)
VALUE rb_f_global_variables(void)
void rb_frozen_class_p(VALUE klass)
static VALUE rb_mod_s_constants(int argc, VALUE *argv, VALUE mod)
void rb_warning(const char *fmt,...)
VALUE rb_f_untrace_var(int, VALUE *)
#define GC_GUARDED_PTR_REF(p)
#define CONST_ID(var, str)
void * ruby_options(int argc, char **argv)
static void rb_longjmp(int tag, volatile VALUE mesg)
void rb_gc_call_finalizer_at_exit(void)
VALUE rb_obj_freeze(VALUE)
static void error_print(void)
static VALUE get_thread_errinfo(rb_thread_t *th)
#define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp)
static VALUE rb_mod_append_features(VALUE module, VALUE include)
VALUE rb_f_trace_var(int, VALUE *)
static VALUE errat_getter(ID id)
void rb_clear_trace_func(void)
void rb_exc_fatal(VALUE mesg)
void ruby_default_signal(int)
void ruby_init_stack(volatile VALUE *)
void rb_threadptr_interrupt(rb_thread_t *th)
void rb_obj_call_init(VALUE obj, int argc, VALUE *argv)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
VALUE rb_str_new2(const char *)
static void errat_setter(VALUE val, ID id, VALUE *var)
static VALUE make_exception(int argc, VALUE *argv, int isstr)
void Init_eval_method(void)
#define NODE_FL_CREF_PUSHED_BY_EVAL