Ruby
2.0.0p648(2015-12-16revision53162)
|
#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 | ruby_tag_type { RUBY_TAG_RETURN = 0x1, RUBY_TAG_BREAK = 0x2, RUBY_TAG_NEXT = 0x3, RUBY_TAG_RETRY = 0x4, RUBY_TAG_REDO = 0x5, RUBY_TAG_RAISE = 0x6, RUBY_TAG_THROW = 0x7, RUBY_TAG_FATAL = 0x8, RUBY_TAG_MASK = 0xf } |
enum | { RAISED_EXCEPTION = 1, RAISED_STACKOVERFLOW = 2, RAISED_NOMEMORY = 4 } |
#define CharNext | ( | p | ) | ((p) + mblen((p), RUBY_MBCHAR_MAXSIZE)) |
Definition at line 226 of file eval_intern.h.
Referenced by cmdglob(), dln_find_1(), has_redirection(), join_argv(), push_include(), rb_w32_cmdvector(), rb_w32_spawn(), and translate_char().
#define EXEC_TAG | ( | ) | TH_EXEC_TAG() |
Definition at line 141 of file eval_intern.h.
Referenced by exec_recursive_i(), rb_debug_inspector_open(), rb_ensure(), rb_eval_cmd(), rb_exec_end_proc(), rb_fiber_start(), rb_iseq_compile_with_option(), rb_load_internal(), rb_load_protect(), rb_method_call_with_block(), rb_require_safe(), rb_rescue2(), 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 24 of file eval_intern.h.
Referenced by error_handle(), exit_initialize(), garbage_collect_with_gvl(), goruby_run_node(), Init_BareVM(), init_libraries_if_necessary(), 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 21 of file eval_intern.h.
Definition at line 181 of file eval_intern.h.
Referenced by rb_iterate(), vm_exec(), and vm_rewrite_ep_in_errinfo().
#define GET_THROWOBJ_STATE | ( | obj | ) | ((int)RNODE((obj))->u3.value) |
Definition at line 182 of file eval_intern.h.
Referenced by thread_join(), and vm_throw().
Definition at line 180 of file eval_intern.h.
Referenced by rb_iterate(), thread_join(), and vm_exec().
#define INTERNAL_EXCEPTION_P | ( | exc | ) | FIXNUM_P(exc) |
Definition at line 150 of file eval_intern.h.
Referenced by setup_exception().
#define JUMP_TAG | ( | st | ) | TH_JUMP_TAG(GET_THREAD(), (st)) |
Definition at line 148 of file eval_intern.h.
Referenced by eval_string_with_cref(), exec_recursive_i(), rb_catch_obj(), rb_debug_inspector_open(), rb_ensure(), rb_eval_cmd(), rb_eval_string_wrap(), rb_iseq_compile_with_option(), rb_jump_tag(), rb_longjmp(), rb_memerror(), rb_method_call_with_block(), rb_raise_jump(), rb_require_safe(), rb_rescue2(), rb_suppress_tracing(), rb_thread_io_blocking_region(), rb_thread_s_handle_interrupt(), rb_throw_obj(), rb_vm_jump_tag_but_local_jump(), setup_exception(), signal_exec(), vm_exec(), and vm_invoke_proc().
#define NEW_THROW_OBJECT | ( | val, | |
pt, | |||
st | |||
) | ((VALUE)rb_node_newnode(NODE_LIT, (VALUE)(val), (VALUE)(pt), (VALUE)(st))) |
Definition at line 173 of file eval_intern.h.
Referenced by rb_throw_obj(), vm_iter_break(), and vm_throw().
#define PASS_PASSED_BLOCK | ( | ) |
Definition at line 12 of file eval_intern.h.
Referenced by rb_call_super(), and rb_obj_call_init().
#define PASS_PASSED_BLOCK_TH | ( | th | ) |
Definition at line 7 of file eval_intern.h.
Referenced by rb_funcall_passing_block(), and send_internal().
#define POP_TAG | ( | ) | TH_POP_TAG() |
Definition at line 137 of file eval_intern.h.
Referenced by exec_recursive_i(), rb_ensure(), rb_eval_cmd(), rb_exec_end_proc(), rb_load_internal(), rb_load_protect(), rb_method_call_with_block(), rb_require_safe(), rb_rescue2(), ruby_cleanup(), ruby_exec_internal(), ruby_finalize_0(), ruby_options(), ruby_setup(), and setup_exception().
#define PUSH_TAG | ( | ) | TH_PUSH_TAG(GET_THREAD()) |
Definition at line 136 of file eval_intern.h.
Referenced by exec_recursive_i(), rb_ensure(), rb_eval_cmd(), rb_exec_end_proc(), rb_load_internal(), rb_load_protect(), rb_method_call_with_block(), rb_require_safe(), rb_rescue2(), ruby_cleanup(), ruby_exec_internal(), ruby_finalize_0(), ruby_options(), ruby_setup(), and setup_exception().
#define rb_thread_raised_clear | ( | th | ) | ((th)->raised_flag = 0) |
Definition at line 201 of file eval_intern.h.
Referenced by error_print(), rb_longjmp(), rb_memerror(), and rb_raise_jump().
Definition at line 200 of file eval_intern.h.
Referenced by rb_memerror(), and stack_check().
Definition at line 199 of file eval_intern.h.
Definition at line 198 of file eval_intern.h.
Referenced by error_print(), rb_memerror(), and stack_check().
Definition at line 51 of file eval_intern.h.
Referenced by cont_restore_1().
Definition at line 50 of file eval_intern.h.
Referenced by cont_capture(), and fiber_store().
#define SAVE_ROOT_JMPBUF | ( | th, | |
stmt | |||
) |
Definition at line 112 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 109 of file eval_intern.h.
#define SAVE_ROOT_JMPBUF_BEFORE_STMT |
Definition at line 108 of file eval_intern.h.
#define SCOPE_CHECK | ( | f | ) | (rb_vm_cref()->nd_visi == (f)) |
Definition at line 185 of file eval_intern.h.
Referenced by rb_attr().
#define SCOPE_SET | ( | f | ) | (rb_vm_cref()->nd_visi = (f)) |
Definition at line 186 of file eval_intern.h.
Referenced by load_ext(), rb_mod_modfunc(), rb_mod_private(), rb_mod_protected(), and rb_mod_public().
#define SCOPE_TEST | ( | f | ) | (rb_vm_cref()->nd_visi & (f)) |
Definition at line 184 of file eval_intern.h.
Referenced by rb_attr().
Definition at line 175 of file eval_intern.h.
Referenced by vm_exec(), and vm_rewrite_ep_in_errinfo().
Definition at line 177 of file eval_intern.h.
Referenced by vm_exec().
#define TAG_BREAK RUBY_TAG_BREAK |
Definition at line 164 of file eval_intern.h.
Referenced by error_handle(), make_localjump_error(), rb_iterate(), rb_vm_make_jump_tag_but_local_jump(), vm_exec(), vm_iter_break(), and vm_throw().
#define TAG_FATAL RUBY_TAG_FATAL |
Definition at line 170 of file eval_intern.h.
Referenced by error_handle(), rb_exc_fatal(), rb_fiber_start(), rb_threadptr_execute_interrupts(), rb_threadptr_to_kill(), setup_exception(), and thread_start_func_2().
#define TAG_MASK RUBY_TAG_MASK |
Definition at line 171 of file eval_intern.h.
Referenced by error_handle().
#define TAG_NEXT RUBY_TAG_NEXT |
Definition at line 165 of file eval_intern.h.
Referenced by error_handle(), make_localjump_error(), rb_vm_make_jump_tag_but_local_jump(), and vm_exec().
#define TAG_RAISE RUBY_TAG_RAISE |
Definition at line 168 of file eval_intern.h.
Referenced by error_handle(), eval_string_with_cref(), rb_exc_raise(), rb_fiber_start(), rb_memerror(), rb_raise_jump(), rb_rescue2(), ruby_thread_stack_overflow(), vm_exec(), and vm_throw().
#define TAG_REDO RUBY_TAG_REDO |
Definition at line 167 of file eval_intern.h.
Referenced by error_handle(), make_localjump_error(), rb_vm_make_jump_tag_but_local_jump(), and vm_exec().
#define TAG_RETRY RUBY_TAG_RETRY |
Definition at line 166 of file eval_intern.h.
Referenced by error_handle(), make_localjump_error(), rb_iterate(), rb_rescue2(), rb_vm_make_jump_tag_but_local_jump(), vm_exec(), and vm_throw().
#define TAG_RETURN RUBY_TAG_RETURN |
Definition at line 163 of file eval_intern.h.
Referenced by error_handle(), make_localjump_error(), rb_vm_make_jump_tag_but_local_jump(), vm_exec(), and vm_throw().
#define TAG_THROW RUBY_TAG_THROW |
Definition at line 169 of file eval_intern.h.
Referenced by error_handle(), rb_catch_obj(), rb_throw_obj(), and vm_throw().
#define TH_EXEC_TAG | ( | ) | ruby_setjmp(_th->tag->buf) |
Definition at line 139 of file eval_intern.h.
Referenced by error_print(), eval_string_with_cref(), exec_hooks(), rb_catch_obj(), rb_iterate(), rb_protect(), rb_rescue2(), rb_suppress_tracing(), and rb_thread_terminate_all().
#define TH_JUMP_TAG | ( | th, | |
st | |||
) |
Definition at line 144 of file eval_intern.h.
Referenced by rb_iterate(), rb_threadptr_exec_event_hooks_orig(), rb_threadptr_to_kill(), ruby_thread_stack_overflow(), and vm_iter_break().
#define TH_POP_TAG | ( | ) |
Definition at line 129 of file eval_intern.h.
Referenced by error_print(), eval_string_with_cref(), exec_hooks(), rb_catch_obj(), rb_debug_inspector_open(), rb_fiber_start(), rb_iseq_compile_with_option(), rb_iterate(), rb_protect(), rb_rescue2(), rb_suppress_tracing(), rb_thread_io_blocking_region(), rb_thread_s_handle_interrupt(), rb_thread_terminate_all(), signal_exec(), thread_start_func_2(), vm_exec(), and vm_invoke_proc().
#define TH_POP_TAG2 | ( | ) | _th->tag = _tag.prev |
Definition at line 133 of file eval_intern.h.
Referenced by vm_exec().
#define TH_PUSH_TAG | ( | th | ) |
Definition at line 122 of file eval_intern.h.
Referenced by error_print(), eval_string_with_cref(), exec_hooks(), rb_catch_obj(), rb_debug_inspector_open(), rb_fiber_start(), rb_iseq_compile_with_option(), rb_iterate(), rb_protect(), rb_rescue2(), rb_suppress_tracing(), rb_thread_io_blocking_region(), rb_thread_s_handle_interrupt(), rb_thread_terminate_all(), signal_exec(), thread_start_func_2(), vm_exec(), and vm_invoke_proc().
anonymous enum |
Enumerator | |
---|---|
RAISED_EXCEPTION | |
RAISED_STACKOVERFLOW | |
RAISED_NOMEMORY |
Definition at line 191 of file eval_intern.h.
enum ruby_tag_type |
Enumerator | |
---|---|
RUBY_TAG_RETURN | |
RUBY_TAG_BREAK | |
RUBY_TAG_NEXT | |
RUBY_TAG_RETRY | |
RUBY_TAG_REDO | |
RUBY_TAG_RAISE | |
RUBY_TAG_THROW | |
RUBY_TAG_FATAL | |
RUBY_TAG_MASK |
Definition at line 152 of file eval_intern.h.
NORETURN | ( | void | rb_method_name_errorVALUE, VALUE | ) |
NORETURN | ( | void | rb_fiber_startvoid | ) |
NORETURN | ( | void | rb_print_undefVALUE, ID, int | ) |
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, VALUE *argv, VALUE obj, int call_status | ) |
Definition at line 1313 of file vm_eval.c.
References argc, argv, eval_string(), NIL_P, NUM2INT, OBJ_TAINTED, Qundef, rb_eSecurityError, rb_raise(), rb_safe_level, rb_scan_args(), SafeStringValue, and StringValue.
Referenced by bind_eval(), and Init_vm_eval().
void rb_thread_cleanup | ( | void | ) |
void rb_thread_terminate_all | ( | void | ) |
Definition at line 409 of file thread.c.
References GET_THREAD(), rb_vm_struct::living_threads, rb_vm_struct::main_thread, rb_bug(), rb_thread_alone(), rb_threadptr_unlock_all_locking_mutexes(), RUBY_VM_CHECK_INTS_BLOCKING, st_foreach(), terminate_i(), rb_mutex_struct::th, TH_EXEC_TAG, TH_POP_TAG, TH_PUSH_TAG, thread_debug, and rb_thread_struct::vm.
Referenced by ruby_cleanup().
void rb_thread_wait_other_threads | ( | void | ) |
int rb_threadptr_reset_raised | ( | rb_thread_t * | th | ) |
Definition at line 2061 of file thread.c.
References RAISED_EXCEPTION, and rb_thread_struct::raised_flag.
Referenced by error_handle(), exec_hooks(), rb_suppress_tracing(), and setup_exception().
int rb_threadptr_set_raised | ( | rb_thread_t * | th | ) |
Definition at line 2051 of file thread.c.
References RAISED_EXCEPTION, and rb_thread_struct::raised_flag.
Referenced by error_handle(), exec_hooks(), rb_suppress_tracing(), and setup_exception().
VALUE rb_vm_call_cfunc | ( | VALUE | recv, |
VALUE(*)(VALUE) | func, | ||
VALUE | arg, | ||
const rb_block_t * | blockptr, | ||
VALUE | filename | ||
) |
Definition at line 1588 of file vm.c.
References rb_thread_struct::cfp, CLASS_OF, DATA_PTR, GET_THREAD(), Qnil, rb_iseq_new(), rb_control_frame_struct::sp, val, VM_ENVVAL_BLOCK_PTR, VM_FRAME_FLAG_FINISH, VM_FRAME_MAGIC_TOP, vm_pop_frame(), and vm_push_frame().
Referenced by rb_require_safe().
VALUE rb_vm_cbase | ( | void | ) |
Definition at line 922 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD(), rb_control_frame_struct::iseq, rb_eRuntimeError, rb_raise(), rb_vm_get_ruby_level_next_cfp(), and vm_get_cbase().
Referenced by rb_f_autoload(), rb_f_autoload_p(), and rb_undef().
NODE* rb_vm_cref | ( | void | ) |
Definition at line 898 of file vm.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD(), rb_control_frame_struct::iseq, NULL, rb_vm_get_cref(), and rb_vm_get_ruby_level_next_cfp().
Referenced by m_core_define_method(), m_core_define_singleton_method(), rb_method_entry_with_refinements(), rb_mod_nesting(), rb_mod_s_constants(), and top_using().
Definition at line 975 of file vm.c.
References GET_THREAD(), make_localjump_error(), Qnil, Qundef, result, rb_vm_tag::retval, rb_thread_struct::tag, TAG_BREAK, TAG_NEXT, TAG_REDO, TAG_RETRY, TAG_RETURN, and val.
Referenced by rb_fiber_start(), rb_vm_jump_tag_but_local_jump(), and thread_join().
void rb_vm_set_progname | ( | VALUE | filename | ) |
Definition at line 2448 of file vm.c.
References GET_VM, rb_control_frame_struct::iseq, rb_iseq_struct::location, rb_iseq_location_struct::path, rb_thread_struct::stack, and rb_thread_struct::stack_size.
Referenced by ruby_script(), and ruby_set_script_name().
VALUE rb_vm_top_self | ( | ) |
Definition at line 2494 of file vm.c.
Referenced by eval_string_from_file_helper(), Init_eval(), Init_eval_method(), Init_Proc(), rb_eval_cmd(), rb_eval_string_wrap(), rb_load_internal(), rb_require_safe(), require_libraries(), and ruby_eval_string_from_file().
Referenced by load_file_internal(), parse_mode_enc(), proc_exec_cmd(), rb_feature_provided(), ruby_init_loadpath_safe(), and search_required().