#include "eval_intern.h"
#include "iseq.h"
#include "gc.h"
#include "ruby/vm.h"
#include "ruby/encoding.h"
#include "eval_error.c"
#include "eval_jump.c"
Go to the source code of this file.
#define exception_error GET_VM()->special_exceptions[ruby_error_reenter] |
Definition at line 30 of file eval.c.
Referenced by Init_eval(), and setup_exception().
#define numberof | ( | array | ) | (int)(sizeof(array) / sizeof((array)[0])) |
Definition at line 20 of file eval.c.
Referenced by ruby_cleanup().
Definition at line 1080 of file eval.c.
References err, get_backtrace(), get_errinfo(), and NIL_P.
Referenced by Init_eval().
Definition at line 1092 of file eval.c.
References err, get_errinfo(), NIL_P, rb_eArgError, rb_raise(), and set_backtrace().
Referenced by Init_eval().
static VALUE* errinfo_place | ( | rb_thread_t * | th | ) | [static] |
Definition at line 993 of file eval.c.
References rb_thread_struct::cfp, rb_control_frame_t::dfp, FIXNUM_P, rb_control_frame_t::iseq, ISEQ_TYPE_ENSURE, ISEQ_TYPE_RESCUE, RUBY_VM_END_CONTROL_FRAME, RUBY_VM_NORMAL_ISEQ_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, RUBY_VM_VALID_CONTROL_FRAME_P, T_NODE, TYPE, and rb_iseq_struct::type.
Referenced by get_thread_errinfo().
static ID frame_func_id | ( | rb_control_frame_t * | cfp | ) | [static] |
Definition at line 770 of file eval.c.
References rb_method_entry_struct::def, rb_iseq_struct::defined_method_id, rb_control_frame_t::iseq, rb_iseq_struct::local_iseq, rb_control_frame_t::me, method_entry_of_iseq(), rb_method_definition_struct::original_id, rb_iseq_struct::parent_iseq, rb_intern, and RUBY_VM_IFUNC_P.
Referenced by rb_frame_callee(), rb_frame_caller(), and rb_frame_this_func().
static VALUE get_errinfo | ( | void | ) | [static] |
Definition at line 1027 of file eval.c.
References GET_THREAD, and get_thread_errinfo().
Referenced by errat_getter(), errat_setter(), errinfo_getter(), rb_f_raise(), and rb_rubylevel_errinfo().
static VALUE get_thread_errinfo | ( | rb_thread_t * | th | ) | [static] |
Definition at line 1015 of file eval.c.
References rb_thread_struct::errinfo, and errinfo_place().
Referenced by get_errinfo().
void Init_BareVM | ( | void | ) |
Definition at line 2127 of file vm.c.
References EXIT_FAILURE, Init_native_thread(), malloc, MEMZERO, rb_vm_struct::objspace, rb_objspace_alloc(), rb_thread_set_current_raw, ruby_thread_init_stack(), th_init2(), rb_thread_struct::vm, and vm_init2().
Referenced by ruby_init().
void Init_eval | ( | void | ) |
Definition at line 1125 of file eval.c.
References errat_getter(), errat_setter(), errinfo_getter(), exception_error, Init_eval_method(), Init_vm_eval(), OBJ_FREEZE, OBJ_TAINT, rb_cClass, rb_cModule, rb_define_global_function(), rb_define_method(), rb_define_private_method(), rb_define_singleton_method(), rb_define_virtual_variable(), rb_eFatal, rb_exc_new3(), rb_f_global_variables(), rb_f_method_name(), rb_f_raise(), rb_f_trace_var(), rb_f_untrace_var(), rb_mKernel, rb_mod_append_features(), rb_mod_extend_object(), rb_mod_include(), rb_mod_nesting(), rb_mod_s_constants(), rb_obj_extend(), rb_obj_freeze(), rb_str_new2(), rb_undef_method(), rb_vm_top_self(), and top_include().
void Init_heap | ( | void | ) |
Definition at line 524 of file eval.c.
References CONST_ID, NIL_P, Qundef, rb_check_funcall(), rb_check_string_type(), rb_eArgError, rb_eException, rb_eRuntimeError, rb_eTypeError, rb_exc_new3(), rb_obj_is_kind_of(), rb_raise(), set_backtrace(), and sysstack_error.
Referenced by rb_exc_fatal(), rb_exc_raise(), and rb_make_exception().
static const rb_method_entry_t* method_entry_of_iseq | ( | rb_control_frame_t * | cfp, | |
rb_iseq_t * | iseq | |||
) | [static] |
Definition at line 755 of file eval.c.
References GET_THREAD, rb_control_frame_t::iseq, rb_control_frame_t::me, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_thread_struct::stack, and rb_thread_struct::stack_size.
Referenced by frame_func_id().
NORETURN | ( | void | rb_raise_jumpVALUE | ) |
NORETURN | ( | static void | rb_longjmpint, volatile VALUE | ) |
VALUE rb_binding_new | ( | void | ) |
Definition at line 309 of file proc.c.
Referenced by call_trace_proc(), Init_VM(), and rb_f_binding().
int rb_block_given_p | ( | void | ) |
Definition at line 603 of file eval.c.
References rb_thread_struct::cfp, GC_GUARDED_PTR_REF, GET_THREAD, and rb_control_frame_t::lfp.
Referenced by dh_generate(), dir_s_chdir(), dir_s_glob(), dir_s_open(), dsa_generate(), enum_chunk(), enum_count(), enum_find_index(), enum_grep(), enum_inject(), enum_max(), enum_min(), enum_minmax(), enum_slice_before(), enum_zip(), enumerator_each(), enumerator_initialize(), env_delete_m(), env_fetch(), env_update_i(), etc_group(), etc_passwd(), fdbm_delete(), fdbm_fetch(), fdbm_fetch_m(), fdbm_s_open(), fgdbm_fetch(), fgdbm_fetch_m(), fgdbm_s_open(), fsdbm_delete(), fsdbm_fetch(), fsdbm_fetch_m(), fsdbm_s_open(), generator_initialize(), iconv_fail_retry(), iconv_s_open(), mSyslog_open(), ossl_pem_passwd_cb(), ossl_x509store_verify(), p_gid_switch(), p_uid_switch(), pack_unpack(), proc_call(), pty_getpty(), pty_open(), range_max(), range_min(), rb_ary_count(), rb_ary_delete(), rb_ary_fetch(), rb_ary_fill(), rb_ary_index(), rb_ary_initialize(), rb_ary_product(), rb_ary_rindex(), rb_ary_sort_bang(), rb_ary_uniq(), rb_ary_uniq_bang(), rb_ary_zip(), rb_dlhandle_initialize(), rb_f_at_exit(), rb_f_open(), rb_hash_delete(), rb_hash_fetch_m(), rb_hash_initialize(), rb_hash_update(), rb_io_s_new(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_iterator_p(), rb_mod_initialize(), rb_need_block(), rb_reg_match_m(), rb_scan_args(), rb_str_match_m(), rb_str_scan(), rb_str_sub_bang(), rb_struct_s_def(), rsa_generate(), specific_eval(), strio_s_open(), thread_initialize(), tk_s_new(), and window_attron().
void rb_call_inits | ( | void | ) |
void rb_clear_trace_func | ( | void | ) |
Definition at line 3895 of file thread.c.
References clear_trace_func_i(), GET_VM, rb_remove_event_hook(), and st_foreach().
Referenced by ruby_finalize_0(), and ruby_options().
Definition at line 736 of file eval.c.
References EXEC_TAG, JUMP_TAG, POP_TAG, PUSH_TAG, and result.
Referenced by _thread_call_proc(), autoload_node(), dir_entries(), dir_foreach(), dir_s_chdir(), dir_s_open(), fdbm_s_open(), fgdbm_s_open(), fole_each(), fsdbm_s_open(), iconv_finish(), iconv_s_conv(), iconv_s_iconv(), iconv_s_open(), io_wait(), lib_eventloop_launcher(), lib_mainloop_watchdog(), load_file(), mSyslog_open(), ossl_verify_cb(), p_gid_switch(), p_uid_switch(), pipe_pair_close(), pty_getpty(), pty_open(), rb_deflate_s_deflate(), rb_dlhandle_initialize(), rb_f_open(), rb_f_select(), rb_gvar_set(), rb_hash_foreach(), rb_inflate_s_inflate(), rb_io_s_binread(), rb_io_s_copy_stream(), rb_io_s_foreach(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_io_s_read(), rb_io_s_readlines(), rb_io_wait_readable(), rb_io_wait_writable(), rb_mutex_sleep(), rb_mutex_synchronize(), rsock_init_inetsock(), rsock_make_hostent(), sig_trap(), strio_s_open(), thread_join(), udp_connect(), and wait_connectable().
VALUE rb_errinfo | ( | void | ) |
Definition at line 1058 of file eval.c.
References rb_thread_struct::errinfo, and GET_THREAD.
void rb_exc_fatal | ( | VALUE | mesg | ) |
Definition at line 468 of file eval.c.
References FALSE, make_exception(), NIL_P, rb_longjmp(), and TAG_FATAL.
Referenced by rb_fatal().
void rb_exc_raise | ( | VALUE | mesg | ) |
Definition at line 459 of file eval.c.
References FALSE, make_exception(), NIL_P, rb_longjmp(), and TAG_RAISE.
Referenced by argument_error(), check_funcall_failed(), cleanup_iseq_build(), cont_capture(), econv_convert(), econv_finish(), econv_init(), econv_s_search_convpath(), eval_string_with_cref(), fiber_store(), fiber_switch(), float_value(), fptr_finalize(), get_next_values(), iconv_create(), iconv_fail_retry(), ip_eval(), ip_invoke_with_position(), lib_eventloop_core(), lib_thread_callback(), load_failed(), make_readconv(), make_writeconv(), more_char(), ossl_raise(), parse_string(), parser_set_encode(), pending_exception_check0(), pending_exception_check1(), process_sflag(), raise_from_check(), raise_method_missing(), raise_zlib_error(), random_rand(), rb_econv_check_error(), rb_enc_reg_raise(), rb_exit(), rb_f_abort(), rb_iconv_sys_fail(), rb_io_initialize(), rb_load_internal(), rb_loaderror(), rb_memerror(), rb_mod_sys_fail(), rb_name_error(), rb_raise(), rb_reg_raise_str(), rb_sys_fail(), rb_threadptr_execute_interrupts_rec(), rb_vm_jump_tag_but_local_jump(), rb_vm_localjump_error(), read_all(), read_would_block(), ruby_thread_stack_overflow(), stack_check(), thread_join(), tk_funcall(), transcode_loop(), vm_push_frame(), and write_would_block().
Definition at line 885 of file eval.c.
References rb_include_module(), and rb_singleton_class().
Referenced by Init_etc(), Init_Hash(), Init_readline(), r_object0(), rb_eval_string_wrap(), rb_load_internal(), rb_mod_extend_object(), rb_mod_sys_fail(), read_would_block(), and write_would_block().
static VALUE rb_f_method_name | ( | void | ) | [static] |
Definition at line 1112 of file eval.c.
References ID2SYM, and rb_frame_caller().
Referenced by Init_eval().
Definition at line 509 of file eval.c.
References err, get_errinfo(), NIL_P, rb_make_exception(), and rb_raise_jump().
Referenced by Init_eval().
VALUE rb_f_trace_var | ( | ) |
Referenced by Init_eval().
VALUE rb_f_untrace_var | ( | ) |
Referenced by Init_eval(), and rb_f_trace_var().
ID rb_frame_callee | ( | void | ) |
Definition at line 804 of file eval.c.
References frame_func_id(), and GET_THREAD.
Referenced by error_pos(), rb_insecure_operation(), rb_secure(), and specific_eval().
static ID rb_frame_caller | ( | void | ) | [static] |
Definition at line 810 of file eval.c.
References rb_thread_struct::cfp, frame_func_id(), GET_THREAD, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_thread_struct::stack, and rb_thread_struct::stack_size.
Referenced by rb_f_method_name().
void rb_frame_pop | ( | void | ) |
Definition at line 822 of file eval.c.
References rb_thread_struct::cfp, GET_THREAD, and RUBY_VM_PREVIOUS_CONTROL_FRAME.
Referenced by rb_mod_const_missing().
ID rb_frame_this_func | ( | void | ) |
Definition at line 798 of file eval.c.
References frame_func_id(), and GET_THREAD.
Referenced by argf_forward(), rb_notimplement(), rb_struct_ref(), rb_struct_set(), recursive_list_access(), and recursive_pop().
void rb_frozen_class_p | ( | VALUE | klass | ) |
Definition at line 340 of file eval.c.
References FL_SINGLETON, FL_TEST, OBJ_FROZEN, rb_error_frozen(), T_CLASS, T_ICLASS, T_MODULE, and TYPE.
Referenced by rb_alias(), rb_include_module(), and rb_undef().
void rb_interrupt | ( | void | ) |
Definition at line 477 of file eval.c.
References rb_eInterrupt, and rb_raise().
Referenced by rb_signal_exec().
int rb_iterator_p | ( | void | ) |
Definition at line 617 of file eval.c.
References rb_block_given_p().
void rb_jump_tag | ( | int | tag | ) |
Definition at line 597 of file eval.c.
References JUMP_TAG.
Referenced by decode_enum(), decode_int(), decode_time(), fdbm_delete_if(), fgdbm_delete_if(), fsdbm_delete_if(), ossl_buf2str(), ossl_membio2str(), ossl_pkcs12_initialize(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_sign(), ossl_pkcs7_verify(), ossl_start_ssl(), pending_exception_check0(), pending_exception_check1(), rb_io_s_pipe(), rb_io_s_read(), readline_readline(), and STACK_OF().
static void rb_longjmp | ( | int | tag, | |
volatile VALUE | mesg | |||
) | [static] |
Definition at line 448 of file eval.c.
References GET_THREAD, JUMP_TAG, rb_thread_raised_clear, and setup_exception().
Referenced by rb_exc_fatal(), and rb_exc_raise().
Definition at line 573 of file eval.c.
References make_exception(), and TRUE.
Referenced by parser_set_encode(), rb_f_raise(), and rb_threadptr_raise().
Definition at line 841 of file eval.c.
References Check_Type, rb_include_module(), T_CLASS, T_MODULE, and TYPE.
Referenced by Init_eval().
Definition at line 864 of file eval.c.
References Check_Type, rb_funcall(), rb_intern, and T_MODULE.
Referenced by Init_eval(), and top_include().
static VALUE rb_mod_nesting | ( | void | ) | [static] |
Definition at line 280 of file eval.c.
References RNode::flags, NIL_P, NODE_FL_CREF_PUSHED_BY_EVAL, rb_ary_new(), rb_ary_push(), and rb_vm_cref().
Referenced by Init_eval().
Definition at line 311 of file eval.c.
References NIL_P, rb_cModule, rb_const_list(), rb_mod_const_at(), rb_mod_const_of(), rb_mod_constants(), and rb_vm_cref().
Referenced by Init_eval().
void rb_need_block | ( | void | ) |
Definition at line 625 of file eval.c.
References Qnil, rb_block_given_p(), and rb_vm_localjump_error().
Referenced by generator_initialize(), and yielder_initialize().
Definition at line 878 of file eval.c.
References PASS_PASSED_BLOCK, and rb_funcall2().
Referenced by rb_class_new_instance(), rb_digest_class_s_digest(), rb_proc_s_new(), and thread_s_new().
Definition at line 950 of file eval.c.
References Check_Type, rb_eArgError, rb_funcall(), rb_intern, rb_raise(), and T_MODULE.
Referenced by Init_eval().
Definition at line 703 of file eval.c.
References rb_thread_struct::cfp, EXEC_TAG, GET_THREAD, MEMCPY, POP_TAG, rb_vm_protect_tag::prev, rb_thread_struct::protect_tag, PUSH_TAG, result, and SAVE_ROOT_JMPBUF.
Referenced by chfunc(), decode_enum(), decode_int(), decode_time(), EVENTSINK_Invoke(), fdbm_delete_if(), fgdbm_delete_if(), fsdbm_delete_if(), goruby_run_node(), ip_eval_real(), ip_invoke_core(), ip_ruby_cmd_receiver_get(), lib_eventloop_core(), lib_eventloop_main(), lib_thread_callback(), load_encoding(), name_err_mesg_to_str(), ossl_buf2str(), ossl_client_cert_cb(), ossl_pem_passwd_cb(), ossl_pkcs12_initialize(), ossl_protect_membio2str(), ossl_protect_obj2bio(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_tmp_dh_callback(), ossl_verify_cb(), rb_eval_string_protect(), rb_glob_caller(), rb_hash_fetch_m(), rb_io_s_pipe(), rb_io_s_read(), readline_readline(), run_finalizer(), and tcl_protect_core().
void rb_raise_jump | ( | VALUE | mesg | ) |
Definition at line 579 of file eval.c.
References rb_method_entry_struct::called_id, rb_thread_struct::cfp, EXEC_EVENT_HOOK, GET_THREAD, JUMP_TAG, rb_method_entry_struct::klass, rb_control_frame_t::me, rb_thread_raised_clear, RUBY_EVENT_C_RETURN, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_control_frame_t::self, setup_exception(), and TAG_RAISE.
Referenced by rb_f_raise().
Definition at line 695 of file eval.c.
References rb_eStandardError, and rb_rescue2().
Referenced by cmp_equal(), do_coerce(), io_close(), and range_init().
VALUE rb_rescue2 | ( | VALUE(*)(ANYARGS) | b_proc, | |
VALUE | data1, | |||
VALUE(*)(ANYARGS) | r_proc, | |||
VALUE | data2, | |||
... | ||||
) |
Definition at line 633 of file eval.c.
References rb_thread_struct::cfp, rb_thread_struct::errinfo, EXEC_TAG, GET_THREAD, JUMP_TAG, POP_TAG, PUSH_TAG, rb_obj_is_kind_of(), result, TAG_RAISE, TAG_RETRY, and va_init_list.
Referenced by argf_readpartial(), check_funcall(), copy_stream_fallback(), rb_f_loop(), rb_rescue(), rb_syck_mktime(), tcl2rb_num_or_str(), tkstr_rescue_float(), tkstr_to_number(), and zip_i().
VALUE rb_rubylevel_errinfo | ( | void | ) |
Definition at line 1074 of file eval.c.
References get_errinfo().
void rb_set_errinfo | ( | VALUE | err | ) |
Definition at line 1065 of file eval.c.
References GET_THREAD, NIL_P, rb_eException, rb_eTypeError, rb_obj_is_kind_of(), and rb_raise().
Referenced by iconv_fail_retry(), load_encoding(), rb_reg_compile(), and reg_compile_gen().
void rb_thread_stop_timer_thread | ( | void | ) |
Definition at line 2716 of file thread.c.
Referenced by rb_thread_terminate_all(), and ruby_cleanup().
int ruby_cleanup | ( | volatile int | ex | ) |
Definition at line 124 of file eval.c.
References err, rb_thread_struct::errinfo, error_handle(), EXEC_TAG, GET_THREAD, GET_VM, NUM2INT, numberof, POP_TAG, PUSH_TAG, rb_eSignal, rb_eSystemExit, rb_iv_get(), rb_obj_is_kind_of(), rb_thread_stop_timer_thread(), rb_thread_terminate_all(), rb_threadptr_check_signal(), rb_threadptr_interrupt(), RTEST, ruby_default_signal(), ruby_finalize_0(), ruby_finalize_1(), ruby_init_stack(), RUBY_VM_CHECK_INTS, ruby_vm_destruct(), rb_thread_struct::safe_level, SAVE_ROOT_JMPBUF, STACK_UPPER, sysexit_status(), and TYPE.
Referenced by ruby_run_node(), and ruby_stop().
static int ruby_exec_internal | ( | void * | n | ) | [static] |
Definition at line 204 of file eval.c.
References rb_thread_struct::base_block, EXEC_TAG, GET_THREAD, POP_TAG, PUSH_TAG, rb_iseq_eval_main(), and SAVE_ROOT_JMPBUF.
Referenced by ruby_exec_node().
int ruby_exec_node | ( | void * | n | ) |
Definition at line 258 of file eval.c.
References ruby_exec_internal(), and ruby_init_stack().
Referenced by ruby_run_node().
int ruby_executable_node | ( | void * | n, | |
int * | status | |||
) |
void ruby_finalize | ( | void | ) |
Definition at line 115 of file eval.c.
References ruby_finalize_0(), and ruby_finalize_1().
Referenced by rb_exit(), and rescue_callback().
static void ruby_finalize_0 | ( | void | ) | [static] |
Definition at line 95 of file eval.c.
References EXEC_TAG, POP_TAG, PUSH_TAG, rb_clear_trace_func(), rb_exec_end_proc(), and rb_trap_exit().
Referenced by ruby_cleanup(), and ruby_finalize().
static void ruby_finalize_1 | ( | void | ) | [static] |
Definition at line 107 of file eval.c.
References GET_THREAD, rb_gc_call_finalizer_at_exit(), and ruby_sig_finalize().
Referenced by ruby_cleanup(), and ruby_finalize().
void ruby_init | ( | void | ) |
Definition at line 45 of file eval.c.
References error_print(), EXEC_TAG, EXIT_FAILURE, GET_VM, Init_BareVM(), Init_heap(), POP_TAG, PUSH_TAG, rb_call_inits(), ruby_init_stack(), and ruby_prog_init().
Referenced by main().
void* ruby_options | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 75 of file eval.c.
References error_handle(), EXEC_TAG, GET_THREAD, INT2FIX, POP_TAG, PUSH_TAG, rb_clear_trace_func(), ruby_init_stack(), ruby_process_options(), and SAVE_ROOT_JMPBUF.
Referenced by main().
int ruby_run_node | ( | void * | n | ) |
Definition at line 247 of file eval.c.
References ruby_cleanup(), ruby_exec_node(), and ruby_executable_node().
void ruby_stop | ( | int | ex | ) |
Definition at line 224 of file eval.c.
References ruby_cleanup().
static void setup_exception | ( | rb_thread_t * | th, | |
int | tag, | |||
volatile VALUE | mesg | |||
) | [static] |
Definition at line 365 of file eval.c.
References rb_thread_struct::cfp, rb_thread_struct::errinfo, exception_error, EXEC_EVENT_HOOK, EXEC_TAG, get_backtrace(), JUMP_TAG, NIL_P, OBJ_FROZEN, POP_TAG, PUSH_TAG, rb_ary_new3(), rb_enc_sprintf(), rb_eRuntimeError, rb_eSystemExit, rb_exc_new(), RB_GC_GUARD, rb_iv_set(), rb_make_backtrace(), rb_obj_as_string(), rb_obj_classname(), rb_obj_dup(), rb_obj_is_kind_of(), rb_sourcefile(), rb_sourceline(), rb_threadptr_reset_raised(), rb_threadptr_set_raised(), rb_trap_restore_mask(), rb_usascii_encoding(), RSTRING_PTR, RTEST, ruby_debug, RUBY_EVENT_RAISE, rb_control_frame_t::self, set_backtrace(), sysstack_error, TAG_FATAL, and warn_printf().
Referenced by rb_longjmp(), and rb_raise_jump().
Definition at line 976 of file eval.c.
References GET_THREAD, rb_cObject, rb_mod_include(), rb_secure(), rb_warning(), and rb_thread_struct::top_wrapper.
Referenced by Init_eval().
Definition at line 27 of file eval.c.
Referenced by Init_Proc(), and make_localjump_error().
Definition at line 28 of file eval.c.
Referenced by error_print(), and Init_Proc().
Definition at line 622 of file eval.c.
Referenced by Init_Thread(), rb_mutex_lock(), rb_mutex_unlock(), rb_thread_stop(), rb_thread_wakeup(), thgroup_add(), thread_create_core(), thread_initialize(), and thread_s_new().