Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "ruby/ruby.h"
#include "vm_core.h"
#include <stdio.h>
#include <setjmp.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#include <sys/stat.h>
Go to the source code of this file.
Enumerations | |
enum | { RAISED_EXCEPTION = 1, RAISED_STACKOVERFLOW = 2, RAISED_NOMEMORY = 4 } |
#define CharNext | ( | p | ) | ((p) + 1) |
Definition at line 299 of file eval_intern.h.
Referenced by dln_find_1(), and push_include().
#define CREF_FL_OMOD_SHARED IMEMO_FL_USER2 |
Definition at line 195 of file eval_intern.h.
Referenced by CREF_OMOD_SHARED(), CREF_OMOD_SHARED_SET(), and CREF_OMOD_SHARED_UNSET().
#define CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1 |
Definition at line 194 of file eval_intern.h.
Referenced by CREF_PUSHED_BY_EVAL(), and CREF_PUSHED_BY_EVAL_SET().
#define EXEC_TAG | ( | ) | TH_EXEC_TAG() |
Definition at line 183 of file eval_intern.h.
Referenced by exec_recursive(), rb_debug_inspector_open(), rb_ensure(), rb_exec_end_proc(), rb_fiber_start(), rb_load_internal0(), rb_load_protect(), rb_postponed_job_flush(), rb_require_internal(), rb_thread_io_blocking_region(), rb_thread_s_handle_interrupt(), ruby_cleanup(), ruby_exec_internal(), ruby_finalize_0(), ruby_options(), ruby_setup(), setup_exception(), signal_exec(), thread_start_func_2(), vm_exec(), and vm_invoke_proc().
#define EXIT_FAILURE 1 |
Definition at line 33 of file eval_intern.h.
Referenced by error_handle(), exit_initialize(), garbage_collect_with_gvl(), goruby_run_node(), Init_BareVM(), init_libraries_if_necessary(), Init_Method(), Messaging_HandleMessage(), negative_size_allocation_error(), nkf_buf_push(), nkf_xmalloc(), nkf_xrealloc(), no_connection2(), pruby_str_to_var(), rb_memerror(), rb_thread_call_with_gvl(), ruby_cleanup(), ruby_executable_node(), ruby_init(), and ruby_memerror().
#define EXIT_SUCCESS 0 |
Definition at line 30 of file eval_intern.h.
#define INTERNAL_EXCEPTION_P | ( | exc | ) | FIXNUM_P(exc) |
Definition at line 190 of file eval_intern.h.
Referenced by setup_exception().
#define JUMP_TAG | ( | st | ) | TH_JUMP_TAG(GET_THREAD(), (st)) |
Definition at line 188 of file eval_intern.h.
Referenced by exec_recursive(), rb_jump_tag(), rb_require_safe(), and rb_vm_jump_tag_but_local_jump().
#define PASS_PASSED_BLOCK_HANDLER | ( | ) | pass_passed_block_handler(GET_THREAD()) |
Definition at line 24 of file eval_intern.h.
Referenced by rb_funcall_passing_block(), and rb_obj_call_init().
#define PASS_PASSED_BLOCK_HANDLER_TH | ( | th | ) | pass_passed_block_handler(th) |
Definition at line 23 of file eval_intern.h.
Referenced by rb_call_super(), and send_internal().
#define POP_TAG | ( | ) | TH_POP_TAG() |
Definition at line 147 of file eval_intern.h.
Referenced by exec_recursive(), rb_load_protect(), ruby_finalize_0(), ruby_options(), and ruby_setup().
#define PUSH_TAG | ( | ) | TH_PUSH_TAG(GET_THREAD()) |
Definition at line 146 of file eval_intern.h.
Referenced by exec_recursive(), rb_load_protect(), ruby_finalize_0(), ruby_options(), and ruby_setup().
#define rb_thread_raised_clear | ( | th | ) | ((th)->raised_flag = 0) |
Definition at line 270 of file eval_intern.h.
Referenced by rb_longjmp(), rb_memerror(), rb_raise_jump(), and rb_threadptr_error_print().
Definition at line 269 of file eval_intern.h.
Referenced by rb_memerror(), and stack_check().
Definition at line 268 of file eval_intern.h.
Definition at line 267 of file eval_intern.h.
Referenced by rb_memerror(), rb_threadptr_error_print(), and stack_check().
Definition at line 60 of file eval_intern.h.
Referenced by cont_restore_1(), and rb_threadptr_tag_jump().
Definition at line 59 of file eval_intern.h.
Referenced by cont_capture(), and fiber_store().
#define SAVE_ROOT_JMPBUF | ( | th, | |
stmt | |||
) |
Definition at line 121 of file eval_intern.h.
Referenced by rb_protect(), ruby_cleanup(), ruby_exec_internal(), ruby_options(), and thread_start_func_2().
#define SAVE_ROOT_JMPBUF_AFTER_STMT |
Definition at line 118 of file eval_intern.h.
#define SAVE_ROOT_JMPBUF_BEFORE_STMT |
Definition at line 117 of file eval_intern.h.
#define TH_EXEC_TAG | ( | ) | (ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(VAR_FROM_MEMORY(_th)) : (TH_REPUSH_TAG(), 0)) |
Definition at line 180 of file eval_intern.h.
Referenced by call_method_data_safe(), eval_string_with_cref(), exec_hooks_protected(), rb_eval_cmd(), rb_iterate0(), rb_protect(), rb_rescue2(), rb_suppress_tracing(), rb_thread_terminate_all(), rb_threadptr_error_print(), run_finalizer(), and vm_catch_protect().
#define TH_JUMP_TAG | ( | th, | |
st | |||
) | rb_threadptr_tag_jump(th, st) |
Definition at line 186 of file eval_intern.h.
Referenced by call_method_data_safe(), eval_string_with_cref(), rb_catch_obj(), rb_debug_inspector_open(), rb_ensure(), rb_eval_cmd(), rb_eval_string_wrap(), rb_iterate0(), rb_load_internal(), rb_longjmp(), rb_memerror(), rb_raise_jump(), rb_rescue2(), rb_suppress_tracing(), rb_thread_io_blocking_region(), rb_thread_s_handle_interrupt(), rb_threadptr_exec_event_hooks_orig(), rb_threadptr_to_kill(), rb_throw_obj(), ruby_thread_stack_overflow(), setup_exception(), signal_exec(), vm_exec(), vm_invoke_proc(), and vm_iter_break().
#define TH_POP_TAG | ( | ) |
Definition at line 137 of file eval_intern.h.
Referenced by call_method_data_safe(), eval_string_with_cref(), exec_hooks_protected(), rb_debug_inspector_open(), rb_ensure(), rb_eval_cmd(), rb_exec_end_proc(), rb_fiber_start(), rb_iterate0(), rb_load_internal0(), rb_postponed_job_flush(), rb_protect(), rb_require_internal(), rb_rescue2(), rb_suppress_tracing(), rb_thread_io_blocking_region(), rb_thread_s_handle_interrupt(), rb_thread_terminate_all(), rb_threadptr_error_print(), ruby_cleanup(), ruby_exec_internal(), run_finalizer(), setup_exception(), signal_exec(), thread_start_func_2(), vm_catch_protect(), vm_exec(), and vm_invoke_proc().
#define TH_PUSH_TAG | ( | th | ) |
Definition at line 131 of file eval_intern.h.
Referenced by call_method_data_safe(), eval_string_with_cref(), exec_hooks_protected(), rb_debug_inspector_open(), rb_ensure(), rb_eval_cmd(), rb_exec_end_proc(), rb_fiber_start(), rb_iterate0(), rb_load_internal0(), rb_postponed_job_flush(), rb_protect(), rb_require_internal(), rb_rescue2(), rb_suppress_tracing(), rb_thread_io_blocking_region(), rb_thread_s_handle_interrupt(), rb_thread_terminate_all(), rb_threadptr_error_print(), ruby_cleanup(), ruby_exec_internal(), run_finalizer(), setup_exception(), signal_exec(), thread_start_func_2(), vm_catch_protect(), vm_exec(), and vm_invoke_proc().
#define TH_REPUSH_TAG | ( | ) | (void)(_th->tag = &_tag) |
Definition at line 144 of file eval_intern.h.
Referenced by rb_exec_end_proc().
#define TH_TMPPOP_TAG | ( | ) | _th->tag = _tag.prev |
Definition at line 141 of file eval_intern.h.
Referenced by rb_exec_end_proc(), and vm_exec().
#define VAR_FROM_MEMORY | ( | var | ) | (var) |
Definition at line 154 of file eval_intern.h.
Referenced by rb_fiber_start().
#define VAR_INITIALIZED | ( | var | ) | ((void)&(var)) |
Definition at line 155 of file eval_intern.h.
Referenced by cont_capture(), and rb_exec_end_proc().
#define VAR_NOCLOBBERED | ( | var | ) | var |
Definition at line 156 of file eval_intern.h.
Referenced by rb_eval_cmd().
anonymous enum |
Enumerator | |
---|---|
RAISED_EXCEPTION | |
RAISED_STACKOVERFLOW | |
RAISED_NOMEMORY |
Definition at line 260 of file eval_intern.h.
Definition at line 198 of file eval_intern.h.
References rb_cref_struct::klass.
Referenced by rb_mod_nesting(), rb_mod_s_constants(), rb_vm_cref_in_context(), rb_vm_rewrite_cref(), vm_cref_dump(), vm_cref_dup(), vm_define_method(), vm_get_cbase(), vm_get_const_base(), vm_get_const_key_cref(), vm_get_cvar_base(), and vm_get_ev_const().
Definition at line 204 of file eval_intern.h.
References rb_cref_struct::next.
Referenced by rb_mod_nesting(), rb_mod_s_constants(), rb_mod_s_used_modules(), rb_vm_cref_in_context(), rb_vm_rewrite_cref(), top_using(), vm_cref_dump(), vm_cref_dup(), vm_cref_new0(), vm_get_cbase(), vm_get_const_base(), vm_get_const_key_cref(), vm_get_cvar_base(), and vm_get_ev_const().
Definition at line 240 of file eval_intern.h.
References CREF_FL_OMOD_SHARED, and rb_cref_struct::flags.
Referenced by rb_using_refinement().
|
inlinestatic |
Definition at line 246 of file eval_intern.h.
References CREF_FL_OMOD_SHARED, and rb_cref_struct::flags.
Referenced by vm_cref_new0().
|
inlinestatic |
Definition at line 252 of file eval_intern.h.
References CREF_FL_OMOD_SHARED, rb_cref_struct::flags, rb_thread_cleanup(), and rb_thread_wait_other_threads().
Referenced by rb_using_refinement(), and vm_cref_dup().
Definition at line 228 of file eval_intern.h.
References CREF_FL_PUSHED_BY_EVAL, and rb_cref_struct::flags.
Referenced by rb_mod_nesting(), rb_mod_s_constants(), vm_cref_dup(), vm_get_const_base(), vm_get_cvar_base(), and vm_get_ev_const().
|
inlinestatic |
Definition at line 234 of file eval_intern.h.
References CREF_FL_PUSHED_BY_EVAL, and rb_cref_struct::flags.
Referenced by vm_cref_new0().
Definition at line 216 of file eval_intern.h.
References rb_cref_struct::refinements.
Referenced by method_entry_resolve_refinement(), rb_mod_s_used_modules(), rb_using_refinement(), vm_call_method_each_type(), vm_cref_dup(), and vm_cref_new0().
Definition at line 222 of file eval_intern.h.
References RB_OBJ_WRITE, and rb_cref_struct::refinements.
Referenced by rb_using_refinement(), rb_yield_refine_block(), and vm_cref_dup().
|
inlinestatic |
Definition at line 210 of file eval_intern.h.
References rb_cref_struct::scope_visi.
Referenced by rb_mod_define_method(), rb_scope_module_func_check(), rb_scope_visibility_get(), and vm_cref_dup().
NORETURN | ( | static inline void | rb_threadptr_tag_jumprb_thread_t *, int | ) |
Referenced by rb_threadptr_tag_state().
NORETURN | ( | void | rb_method_name_errorVALUE, VALUE | ) |
NORETURN | ( | void | rb_fiber_startvoid | ) |
NORETURN | ( | void | rb_print_undefVALUE, ID, rb_method_visibility_t | ) |
NORETURN | ( | void | rb_vm_localjump_errorconst char *, VALUE, int | ) |
NORETURN | ( | void | rb_vm_jump_tag_but_local_jumpint | ) |
NORETURN | ( | void | rb_raise_method_missingrb_thread_t *th, int argc, const VALUE *argv, VALUE obj, int call_status | ) |
|
inlinestatic |
Definition at line 15 of file eval_intern.h.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, rb_vm_frame_block_handler(), VM_ASSERT, vm_block_handler_verify(), VM_ENV_FLAGS_SET(), VM_FRAME_FLAG_PASSED, and vm_passed_block_handler_set().
Definition at line 1436 of file vm_eval.c.
References eval_string(), NIL_P, NUM2INT, Qundef, rb_scan_args(), SafeStringValue, and StringValue.
Referenced by bind_eval(), and Init_vm_eval().
void rb_thread_cleanup | ( | void | ) |
Referenced by CREF_OMOD_SHARED_UNSET().
void rb_thread_terminate_all | ( | void | ) |
Definition at line 472 of file thread.c.
References GET_THREAD, rb_vm_struct::main_thread, rb_bug(), rb_threadptr_unlock_all_locking_mutexes(), RUBY_VM_CHECK_INTS_BLOCKING, terminate_all(), waiting_fd::th, TH_EXEC_TAG, TH_POP_TAG, TH_PUSH_TAG, thread_debug, rb_thread_struct::vm, and vm_living_thread_num().
Referenced by ruby_cleanup().
void rb_thread_wait_other_threads | ( | void | ) |
Referenced by CREF_OMOD_SHARED_UNSET().
int rb_threadptr_reset_raised | ( | rb_thread_t * | th | ) |
Definition at line 2190 of file thread.c.
References RAISED_EXCEPTION, and rb_thread_struct::raised_flag.
Referenced by error_handle(), exec_hooks_protected(), rb_suppress_tracing(), and setup_exception().
int rb_threadptr_set_raised | ( | rb_thread_t * | th | ) |
Definition at line 2180 of file thread.c.
References RAISED_EXCEPTION, and rb_thread_struct::raised_flag.
Referenced by error_handle(), exec_hooks_protected(), rb_suppress_tracing(), and setup_exception().
|
inlinestatic |
Definition at line 170 of file eval_intern.h.
References rb_vm_tag::buf, ruby_longjmp, rb_thread_struct::state, and rb_thread_struct::tag.
Referenced by rb_threadptr_tag_state().
|
inlinestatic |
Definition at line 161 of file eval_intern.h.
References NORETURN(), rb_threadptr_tag_jump(), and rb_thread_struct::state.
VALUE rb_vm_call_cfunc | ( | VALUE | recv, |
VALUE(*)(VALUE) | func, | ||
VALUE | arg, | ||
VALUE | block_handler, | ||
VALUE | filename | ||
) |
Definition at line 2077 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD, rb_captured_block::iseq, Qnil, rb_iseq_new(), rb_vm_pop_frame(), rb_vm_trace_mark_event_hooks(), rb_control_frame_struct::sp, rb_captured_block::val, vm_cref_new_toplevel(), VM_ENV_FLAG_LOCAL, VM_FRAME_FLAG_FINISH, VM_FRAME_MAGIC_TOP, and vm_push_frame().
Referenced by rb_require_internal().
VALUE rb_vm_cbase | ( | void | ) |
Definition at line 1346 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD, rb_eRuntimeError, rb_raise(), rb_vm_get_ruby_level_next_cfp(), and vm_get_cbase().
Referenced by rb_f_autoload(), and rb_f_autoload_p().
rb_cref_t* rb_vm_cref | ( | void | ) |
Definition at line 1299 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD, NULL, rb_vm_get_cref(), and rb_vm_get_ruby_level_next_cfp().
Referenced by method_entry_resolve_refinement(), rb_mod_nesting(), rb_mod_s_constants(), rb_mod_s_used_modules(), rb_scope_module_func_check(), rb_scope_visibility_get(), top_using(), vm_cref_set_visibility(), and vm_define_method().
rb_cref_t* rb_vm_cref_replace_with_duplicated_cref | ( | void | ) |
Definition at line 1312 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD, rb_vm_get_ruby_level_next_cfp(), and vm_cref_replace_with_duplicated_cref().
Referenced by mod_using(), and top_using().
Definition at line 1399 of file vm.c.
References GET_THREAD, make_localjump_error(), Qnil, Qundef, result, TAG_BREAK, TAG_NEXT, TAG_REDO, TAG_RETRY, and TAG_RETURN.
Referenced by rb_fiber_start(), rb_load_internal0(), and rb_vm_jump_tag_but_local_jump().
void rb_vm_set_progname | ( | VALUE | filename | ) |
Definition at line 3096 of file vm.c.
References rb_iseq_struct::body, GET_VM, rb_control_frame_struct::iseq, rb_iseq_constant_body::location, rb_iseq_location_struct::path, RB_OBJ_WRITE, rb_thread_struct::stack, and rb_thread_struct::stack_size.
Referenced by ruby_script(), and ruby_set_script_name().
Referenced by parse_mode_enc(), rb_feature_provided(), ruby_init_loadpath_safe(), and search_required().
|
inlinestatic |
Definition at line 8 of file eval_intern.h.
References rb_thread_struct::passed_block_handler, VM_ASSERT, and vm_block_handler_verify().
Referenced by call_method_data(), call_method_entry(), method_missing(), pass_passed_block_handler(), rb_funcall_with_block(), rb_iterate0(), rb_raise_method_missing(), refine_sym_proc_call(), and vm_call0_body().